DB2 Select

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bearamg
    New Member
    • Feb 2006
    • 1

    DB2 Select

    I need a DB2 Select statement that counts the number of Duplicate values for a paricular column?

    thanks...
  • ganeshmn25
    New Member
    • Aug 2008
    • 28

    #2
    Hi ,

    To count the number of duplicate values of a particular column in a table
    you can make use of the following query,

    SELECT email,
    COUNT(email) AS NumOccurrences
    FROM users
    GROUP BY email
    HAVING ( COUNT(email) > 1 )



    Regards
    Padmanaban.N
    DB2 Associate

    Comment

    Working...