Need only Unique records

  • Hi All!

    I have a table with tens of thousands of rows. I have a cloumn titled "ID" and I need to retrieve each ID that only appears in the table once. I don't need to see only distinct ID's in my results (i.e. SELECT DISTINCT), but only ID's that are in the ID column one time in the entire table.

    Any suggestions?

    Thanks!

  • Something like

    Select ID, count(*)

    from table

    group by ID

    having count(*) = 1

  • Thanks! That was simple enough. I'm still a newbie 😀

  • No problem. We all start somewhere. 🙂

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

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