COUNT FUNCTION

  • I was trying to understand the count function but its not happening to the mark.

    I am a bit unsatisfied with the explanations provided in different tutorials.

    Could some one give me a brief explanation with syntax and examples

  • select Count(*) from table -Returns the Total Number of rows in a table

    select Columnname, Count(*) from table group by columnname having having count(*) >1

    Gives the number of repeated rows along with the row repeating.

    The above two are frequently I use.

    [font="Tahoma"]
    --SQLFRNDZ[/url]
    [/font]

  • ash0550 (6/8/2011)


    I was trying to understand the count function but its not happening to the mark.

    I am a bit unsatisfied with the explanations provided in different tutorials.

    Could some one give me a brief explanation with syntax and examples

    Whats your specific question on Count function. Its pretty simple as that count(*) counts the number of rows in a table.

  • ash0550 (6/8/2011)


    I was trying to understand the count function but its not happening to the mark.

    I am a bit unsatisfied with the explanations provided in different tutorials.

    Could some one give me a brief explanation with syntax and examples

    Do what I do. Make some test data and try using it. It's one of the best ways to learn.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (6/9/2011)


    ash0550 (6/8/2011)


    I was trying to understand the count function but its not happening to the mark.

    I am a bit unsatisfied with the explanations provided in different tutorials.

    Could some one give me a brief explanation with syntax and examples

    Do what I do. Make some test data and try using it. It's one of the best ways to learn.

    Thanks man it has been useful

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

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