Output of Query

  • Hugo Kornelis (10/28/2010)


    I wrote that NULL does not represent unknown.

    I understand that is what you wrote.

    I thought maybe you would look at the referenced article before responding.

    Let me grab another cut and paste of the BOL that was referenced for the question.

    "The value NULL means the data value for the column is unknown or not available."

    That is the very first sentance from the Books online:

    http://msdn.microsoft.com/en-us/library/ms191270%28v=SQL.100%29.aspx

    Now I understand that the Books Online have often been wrong.

    Do you believe they are in this instance?

  • SanDroid (10/28/2010)


    Hugo Kornelis (10/28/2010)


    I wrote that NULL does not represent unknown.

    I understand that is what you wrote.

    I thought maybe you would look at the referenced article before responding.

    Since you didn't provide a reference and didn't indicate in any way that you wanted me to comment on the part you didn't quote, I could only assume that the quoted text was what you wanted me to comment on.

    Let me grab another cut and paste of the BOL that was referenced for the question.

    "The value NULL means the data value for the column is unknown or not available."

    That is the very first sentance from the Books online:

    http://msdn.microsoft.com/en-us/library/ms191270%28v=SQL.100%29.aspx

    Now I understand that the Books Online have often been wrong.

    Do you believe they are in this instance?

    Thanks for the reference. I have now read the entire article.

    I qualify it as sloppy, not as wrong. The first line you quote above is "sort of" correct. Since NULL represents missing data, "not available" is spot-on. The additional "unknown" in that sentence is superfluous, a bit like describing someone as "New Yorker or American" - unknown is a subset of missing value, as New Yorker is a subset of American.

    In the paragraph on camparing NULL values, I find this sentence, as an explanation of why NULL comparisons yield UNKNOWN:

    "This is because a value that is unknown cannot be compared logically against any other value."

    The "value is unknown" here is the old incorrect interpretation of NULL. But after the introductory paragraph above, this is easily identified as a sloppy reference, and it won't be taken as a change to the previous explanation.

    This kind of sloppiness annoys me. But I count my blessings - I've seen BOL pages that were much, much worse than this one.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Thanks for the question.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • Thanks to OP and special thanks to HUGO for great explanation.

    -------Bhuvnesh----------
    I work only to learn Sql Server...though my company pays me for getting their stuff done;-)

  • Um, NO! You have inverted the condition on the <> '1' to = '1' with this "IN" statement.

  • Thanks Hugo!

    Your comments help to learn more.

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply