• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sreenivasan M
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the exact function of count(*)???

and what does "SELECT count(*) from Table" syntax do and signify???
 
vishwanath nadimpally
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks vishwanath and chadra prakash
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34695
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic