What is the difference between the following two sql
statements
select count(*) from <tablename>
select count(col_name) from <tablename>

Answer Posted / sandeep

select count(*) from <tablename>
- return number of records from table


select count(col_name) from <tablename>
- return number of records where col_name is NOT NULL
- Null value is eliminated by an aggregate or other SET
operation.

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How you can add messages to the nt event log from within a stored procedure?

577


Explain the cursor lock types?

557


How to change the system date and time from SQL Plus Terminal ?

691


I have triggers,views,functions,stored Procedures for a table. When I am dropping that table which objects are deleted?

607


What is normalization process?

604






What is a linked server in sql server?

579


Determine when to use stored procedure to complete sql server tasks?

543


In case you have filters in your report, when filters will be applied in cached report instance?

81


What is function of CUBE ?

613


What is the difference between stored procedure and user defined functions?

632


What are the five major components of a dbms?

518


what are user defined datatypes? : Sql server database administration

524


What is the tcp/ip port on which sql server runs?

570


Define Joins?

618


Detail about the hardware which is supported by SQL server?

591