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
Why main is user defined function?
What is the name of the system variable that returns the number of rows affected by a SQL statement?
What is ms sql server reporting services?
How do we Backup SQL Azure Data?
How to include date and time values in sql statements?
When we should use and scope of @@identity?
What are the different type of replication in sql server?
What is sql server english query?
your sql server is running out of disk space. You notice that there are several large files with ldf extensions what are these files? : Sql server administration
my name is sejal I have cleared the sbi clerk exam. I am BCA graduate My favorite subject RDBMS Relational database management system. so please send me rRDBMS related interview questions
What is attribute relationships, why we need it? : sql server analysis services, ssas
What is single-user mode?
Create a dts package to produce a text file using the ‘update statistics’ command for the tables in a database with obsolete statistics.
What sql server means?
Does full backup break log chain?