unable to count the occurance of column values..

  • Hi ,

    I have a table product and it it has a column HardDisk

    HardDisk

    12

    15

    12

    15

    40

    4

    18

    19

    19

    19

    19

    17

    1

    2

    Overall my condition is that if occurrence of any value is>= 2 then it should come in my result

    and I need output like this:

    Harddisk

    12

    4

    15

    19

    ...

  • here you goes.

    SELECT COUNT(HardDisk) ,

    HardDisk

    FROM product

    GROUP BY HardDisk

    HAVING COUNT(HardDisk) >= 2

  • Thanks a lot

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

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