treat nulls in count function?

  • Hi ,

    I have a column "name" where i have 7 values +2 nulls and when i use query

    select count(name ) from employee

    is gives me 7 and it doesn't count null..I knw this wont count but if we want to count it (i mean if we just want to check total rows in the column how we can do that?

  • Try to google or search this site for the difference between COUNT(*) and COUNT(column_name).



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Try this link 😎

    It's helpful for what you are needing and will provide a little humor for the day!

    ______________________________________________________________________________Never argue with an idiot; Theyll drag you down to their level and beat you with experience

  • 🙂 funny it was!!!

  • http://sqlinthewild.co.za/index.php/2009/04/14/on-counts/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

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

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