Home » SQL & PL/SQL » SQL & PL/SQL » what is count(1)
what is count(1) [message #1710] Thu, 23 May 2002 14:10 Go to next message
pavani
Messages: 32
Registered: April 2002
Member
i saw using count(1) in select statements does that mean 1st column of the table i'm doubt of that plz let me know
Re: what is count(1) [message #1713 is a reply to message #1710] Thu, 23 May 2002 21:17 Go to previous messageGo to next message
Amit
Messages: 166
Registered: February 1999
Senior Member
N0 it is not like that
count(1) means column 1 count
I think
query select count(1) from table name requires less time
than
select count(*) from table name but both queries will give same output
Re: what is count(1) [message #1719 is a reply to message #1710] Fri, 24 May 2002 01:43 Go to previous message
M.P.KIRAN KUMAR
Messages: 9
Registered: May 2002
Junior Member
hi,

count(*) displays number of rows , in that * means
all the columns, so if we use count(1) it will take only one column i.e. p.k. so the fetching will be very fast....

another way u can use count(rowid)..

bye
Previous Topic: URGENT:Problem with variable in a trigger
Next Topic: How do I select the LAST RECORD of the Table?
Goto Forum:
  


Current Time: Thu Apr 25 12:22:45 CDT 2024