Garima Bansal

Garima Bansal

  • 1.1k
  • 669
  • 38.6k

Delete duplicate rows keeping the first row

Apr 8 2024 12:09 PM

How can I delete duplicate rows where no unique row id exists?

My table is

col1  col2 col3 col4 col5 col6 col7
John  1    1    1    1    1    1 
John  1    1    1    1    1    1
Sally 2    2    2    2    2    2
Sally 2    2    2    2    2    2

I want to be left with the following after the duplicate removal:

john  1    1    1    1    1    1
sally 2    2    2    2    2    2

I've tried a few queries but I think they depend on having a row id as I don't get the desired result.


Answers (1)