What is the difference between the following two sql
statements
select count(*) from <tablename>
select count(col_name) from <tablename>
Answer Posted / debasis
select count(*) from <tablename> returns the number of rows
in the table.
select count(col_name) from <tablename> return number
values in the column (Ignores null value in the colum). For
example if we execute the following 2 queries then
select count(*) form emp
select count(comm) form emp
The result will be
14
4
| Is This Answer Correct ? | 34 Yes | 7 No |
Post New Answer View All Answers
How to loop through result set objects using odbc_fetch_row()?
What is a join in sql? What are the types of joins?
Please explain that what are the basic functions for master, msdb, model, tempdb and resource databases? : SQL Server Architecture
Is mysql the same as sql server?
What is openxml in sql server?
Do you know sql server 2008 introduces automatic auditing?
wat wil hapn if we give the both read and deny read permission to user?
How to provide values to user defined function parameters?
How is a full-text index updated?
What are the advantages of paper records?
Explain an incremental backup?
Explain about remote stored procedure?
can we have a nested transaction? : Sql server database administration
can a table be moved to different filegroup? : Sql server administration
Explain the difference between cross join and full outer join?