Basic COUNTs 4

  • Comments posted to this topic are about the item Basic COUNTs 4

  • nice question... thanks

    Manik
    You cannot get to the top by sitting on your bottom.

  • Thanks for this question! I recently re-learned this info, and the way I remembered it (I know it's probably a bad mnemonic but it works for me) is: "COUNT (ALL col) does not COUNT ALL"  -meaning it excludes NULLs.

    - webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • Interesting....
    thanks for the question, Steve

    ____________________________________________
    Space, the final frontier? not any more...
    All limits henceforth are self-imposed.
    “libera tute vulgaris ex”

  • Interesting question. "The ALL will be applied to all values, with the NULL eliminated" may be incorrect. I tried running the same query without COUNT() and found NULL value in the result set. 
    SELECT
    ALL tc.varcharcol
    FROM dbo.TheCounts AS tc

Viewing 5 posts - 1 through 4 (of 4 total)

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