Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase «««1234

SELECT FUN Expand / Collapse
Author
Message
Posted Tuesday, May 5, 2009 9:22 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: Administrators
Last Login: Today @ 12:38 AM
Points: 33,267, Visits: 15,436
When a question is ambiguous and I've (usually) been chastised properly by Hugo for letting it slip through, I correct the question and then award everyone who has answered to that time, a correct mark. With points added back.







Follow me on Twitter: @way0utwest

Forum Etiquette: How to post data/code on a forum to get the best help
Post #710361
Posted Thursday, May 7, 2009 9:10 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, July 5, 2013 11:51 PM
Points: 488, Visits: 336
I got it wrong because I thought TWO NULL Values are NOT supposed to be same(identical). So I chose the option with 3 rows. Quirk of SQLServer?



Saurabh Dwivedy
___________________________________________________________

My Blog: http://tinyurl.com/dwivedys

For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537

Be Happy!
Post #712575
Posted Friday, May 8, 2009 2:12 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 5:07 PM
Points: 6,002, Visits: 8,266
saurabh.dwivedy (5/7/2009)
I got it wrong because I thought TWO NULL Values are NOT supposed to be same(identical). So I chose the option with 3 rows. Quirk of SQLServer?


No quirk. Expected behaviour, as required by the ANSI standard.

NULL values are considered to yield "unknown" (not false!) on any comparison predicate, so they are neither equal nor unequal. But that does not apply here. This is a grouping operation, and the ANSI standard explicitly states that NULL values are considered to be not distinct for grouping purposes.



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #712706
Posted Friday, May 8, 2009 2:20 AM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Friday, July 5, 2013 11:51 PM
Points: 488, Visits: 336
Hugo Kornelis (5/8/2009)
saurabh.dwivedy (5/7/2009)
I got it wrong because I thought TWO NULL Values are NOT supposed to be same(identical). So I chose the option with 3 rows. Quirk of SQLServer?


No quirk. Expected behaviour, as required by the ANSI standard.

NULL values are considered to yield "unknown" (not false!) on any comparison predicate, so they are neither equal nor unequal. But that does not apply here. This is a grouping operation, and the ANSI standard explicitly states that NULL values are considered to be not distinct for grouping purposes.


Thanks. Appreciate it.


Saurabh Dwivedy
___________________________________________________________

My Blog: http://tinyurl.com/dwivedys

For better, quicker answers, click on the following...
http://www.sqlservercentral.com/articles/Best+Practices/61537

Be Happy!
Post #712710
Posted Friday, December 24, 2010 8:47 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Today @ 5:36 PM
Points: 1,786, Visits: 1,116
Hugo,
I agree with your points. I did select wrong answer but it is a good learning experience and i did not know that order by in UNION would make a difference. I had the impression that UNION would not take the nulls like UNION ALL. Thanks for the clarifying it.
Post #1039124
« Prev Topic | Next Topic »

Add to briefcase «««1234

Permissions Expand / Collapse