Advertisement

04.12.2008 at 07:07AM PDT, ID: 23317325
[x]
Attachment Details

MySQL - delete rows with a duplicate field

Asked by willsherwood in MySQL

how can i execute a (one-time) SQL stmt that deletes rows that have a duplicate value...
something like:

DELETE FROM T WHERE A=another(A)

thus
ID     A
1      x
2      y
3      z
4      z
5      y

would delete either row 3 or 4 (doesn't matter to me which, just not both :)    )

thanksStart Free Trial
[+][-]04.12.2008 at 07:10AM PDT, ID: 21341193

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: MySQL
Sign Up Now!
Solution Provided By: angelIII
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.12.2008 at 07:13AM PDT, ID: 21341210

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628