DELETE rows?
Hi, I am kinda new to mysql. Here is my question:
Let's say I have a table with two cols, id and number. Some of the ids are duplicated in two different rows (max. two rows). For a given such id I would like to delete the row with greater value of number. Can I write a query or multiple queries to do something like that, or I will have to write a php code to do that.
Here is the sample data:
"id1", 20
"id2", 1
"id2", 3 <- need to delete this
"id3", 4
"id4", 1
"id3", 6 <- need to delete this
Any guru out there?
Subject
Written By
Posted
DELETE rows?
June 15, 2010 08:53PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.