|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Saturday, November 27, 2010 11:14 PM
Points: 356,
Visits: 99
|
|
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.
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 10:33 AM
Points: 10,989,
Visits: 10,529
|
|
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.
Paul White SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Wednesday, July 25, 2012 9:04 PM
Points: 542,
Visits: 187
|
|
All is by default so II & III are same expressions
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Sunday, March 04, 2012 4:02 AM
Points: 660,
Visits: 134
|
|
| I think this question could have been worded better and is incomplete.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, January 07, 2013 8:06 AM
Points: 15,
Visits: 12
|
|
explination given here is not fully correct-->"SELECT COUNT_BIG(ALL COlumn_2) and SELECT COUNT_BIG(column_2). COUNT_BIG(all column_2) will count all rows from the table (including duplicate & null rows). COUNT_BIG(DISTINCT column_2) will evaluate distinct non-null values.
 because ---> "COUNT_BIG(all column_2) will count all rows from the table including duplicate & Excluding null rows).
and COUNT_BIG(*) will count all rows from the table (including duplicate & null rows).
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Monday, January 07, 2013 8:06 AM
Points: 15,
Visits: 12
|
|
explanation given here is not fully correct-->"SELECT COUNT_BIG(ALL COlumn_2) and SELECT COUNT_BIG(column_2). COUNT_BIG(all column_2) will count all rows from the table (including duplicate & null rows). COUNT_BIG(DISTINCT column_2) will evaluate distinct non-null values.
 because ---> "COUNT_BIG(all column_2) will count all rows from the table including duplicate & Excluding null rows).
and COUNT_BIG(*) will count all rows from the table (including duplicate & null rows).
|
|
|
|