SQL Interview Question

Question: What are the output of below query?


SELECT COUNT(*) FROM TBL
SELECT COUNT(1) FROM TBL

SELECT COUNT(ID) FROM TBL




Answer:

SELECT COUNT(*) FROM TBL -- 5
SELECT COUNT(1) FROM TBL -- 5


SELECT COUNT(ID) FROM TBL -- 4 not include Null value

Comments

Popular posts from this blog

iframe vs embed vs object in HTML 5

Constructor in c#

What is the need of method overriding ???