how to delete one row when you have the same one twice

+1 tal barak · November 7, 2015
i accidently inserted the same row twice, how do i delete only one?

Post a Reply

Replies

Oldest  Newest  Rating
0 Monty Mason · November 11, 2015
Do you have an ID column in the table or document (if you're using NoSQL database)?

If you do, simply track down the ID number of those records, choose one you wish to delete and delete using that specific ID number.

Example could look like:

select * from TABLE_NAME;

- Take note of row you want to delete and it's ID value.

delete from TABLE_NAME
where ID_Column = VALUE;
0 Steven the awesome · November 11, 2015
Can give some more information, what does your  database structure looks like?
0 tal barak · November 20, 2015
thank you :)
  • 1

SQL & Databases

107,311 followers
About

Everything SQL and Databases related in here!

Links
Moderators
Bucky Roberts Administrator