help me

  • I have a table with one column which has many records which are not distinct. I need to find the distinct values from that column and number of times it’s repeated.

    Regards

    Binu John

  • Binu - I can't test this right now but it should be something like:

    select Column, count(Column) as Number

    from table group by Column

    having count(Column) > 1







    **ASCII stupid question, get a stupid ANSI !!!**

  • Binu - Reply by Sushila will give you duplicate records only.  If you want to see the distinct column value then you can use the following query:

    Select distinct Column from Table

    if you want to see all the records with its occurrence then the following query should be used.

    Select column,Count(*) as number from table group by column

     

  • Yes - my response will get only those values that are duplicate (somehow "reading between the lines" that is what I thought was the requirement)....

    and yes - if you remove the "having..." clause from my statement shakti's 2nd statement will do the job!







    **ASCII stupid question, get a stupid ANSI !!!**

  • Thanks a ton Shakti and Susheela

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

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