Avaneesh -388582 (5/20/2010)
Hi,I. SELECT COUNT_BIG(*)
II. SELECT COUNT_BIG(column_2)
III. SELECT COUNT_BIG(ALL column_2)
IV. SELECT COUNT_BIG(DISTINCT column_2)
I Answered this question selecting II,III and IV (which actually is a correct answer) guess what i was indicated as INCORRECT! Pls let me know if I am so.
coz all the three (2,3,4) have same output.
Wow! That's amazing! What code did you use to come to that conclusion? I used this:
DECLARE @QotD
TABLE (
Column_1 TINYINT NOT NULL,
Column_2 TINYINT NULL
);
INSERT @QotD VALUES (1, 1);
INSERT @QotD VALUES (2, NULL);
INSERT @QotD VALUES (3, 2);
INSERT @QotD VALUES (4, 2);
INSERT @QotD VALUES (5, NULL);
INSERT @QotD VALUES (6, 3);
INSERT @QotD VALUES (7, 4);
INSERT @QotD VALUES (8, 5);
INSERT @QotD VALUES (9, 6);
INSERT @QotD VALUES (10, 7);
--I.
SELECT COUNT_BIG(*) FROM @QotD;
--II.
SELECT COUNT_BIG(Column_2) FROM @QotD;
--III.
SELECT COUNT_BIG(ALL Column_2) FROM @QotD;
--IV.
SELECT COUNT_BIG(DISTINCT Column_2) FROM @QotD;
I Answered this question selecting II,III (which actually is a correct answer) guess what i was indicated as CORRECT! Pls let me know if I am so. coz all the two (2,3) have same output. :laugh:
Paul White
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi