*
The moose likes JDBC and the fly likes what does Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "what does "SELECT count(*) from Tablename"  mean" Watch "what does "SELECT count(*) from Tablename"  mean" New topic
Author

what does "SELECT count(*) from Tablename" mean

Sreenivasan M
Greenhorn

Joined: Oct 05, 2006
Posts: 10
what is the exact function of count(*)???

and what does "SELECT count(*) from Table" syntax do and signify???
vishwanath nadimpally
Ranch Hand

Joined: Jan 25, 2005
Posts: 116
count(argument) returns the number of rows (records) for this column(argument) in a table.

This returns the number of rows (records) in that table.

refer to this for more http://www.sql-tutorial.net/SQL-COUNT.asp
Cp Baherwani
Ranch Hand

Joined: May 13, 2005
Posts: 41
count function gives the number of rows in a group/table.
"select count(*) from employee"
gives the total number of rows (employees) in the employee table.

"select count(*), department from employee group by department"
gives the number of employees in each department.
Sreenivasan M
Greenhorn

Joined: Oct 05, 2006
Posts: 10
thanks vishwanath and chadra prakash
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30123
    
150

"Think Mad",
In case you didn't see my note in your other thread, note that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks,
Jeanne
Forum Bartender


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what does "SELECT count(*) from Tablename" mean
 
Similar Threads
migration from MS sql 2000 to MS sql 2008
Counting number of rows returned by select
count(*) vs count(id)
Select multiple tables using single resultset - SQLException: ORA-00933: SQL command not properly en
How do I format this query using JSP?