selecting the duplicate data

  • Hi guys

    I have a table like this below. How can I select the duplicate "colorNO" in the table, when I supply the "OID"

    i.e. when i give OID = 666, then the query should display '540'

     

    ID         OID            ColorNO

    --------------------------------

    153       666            Test Shade 1       

    154       666            5M 3               

    155       666            540                

    156       666            540 

     

    any help will be appreciated

  • Select ColorNO from dbo.YourTable where OID = 666 group by ColorNO

    having count(*) > 1

  • thanks

  • HTH

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

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