small clarification

  • Hi ,

    I have 1billion records in a table where i have an "Type" column now i need to check whether data exists for Type= 6 which one is better

    1.Count(*) where type=6

    2.count(1) where type=6

    3.IF exists

    if any other please suggest

    /********************************************************
    Technology is just a tool,in terms of getting the kids working together and motivating them,the teacher is the most important.
    ********************************************************/

  • 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
  • It is very useful thank you very much Gail

    /********************************************************
    Technology is just a tool,in terms of getting the kids working together and motivating them,the teacher is the most important.
    ********************************************************/

Viewing 3 posts - 1 through 2 (of 2 total)

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