create a unique key on city,cc columns with ignore option of alter table it
will keep the first row and deletes redundant rows.

check the below link for alter table syntax

http://dev.mysql.com/doc/mysql/en/ALTER_TABLE.html

Anil





-----Original Message-----
From: Walter Pucko [mailto:[EMAIL PROTECTED]
Sent: Monday, December 13, 2004 10:04 PM
To: [EMAIL PROTECTED]
Subject: Deleting redundant rows


Hello there,

I do have a table in mysql 4.x with redundant info. Only the autoincrement
ID is different.

Example:
ID      city    cc
2559756 Witkop  SF
2559757 Witkop  SF

This turns to be a huge problem since I cant find a way to delete the
redundant rows with a mysql query. Is there a solution for that? I tried it
with distinct, but that does not work, with subselects but this seems not to
be supported.

I am lost here, maybe someone with better sql knowledge can help out.

Thank you for any help,

Merlin

--
GMX ProMail mit bestem Virenschutz http://www.gmx.net/de/go/mail
+++ Empfehlung der Redaktion +++ Internet Professionell 10/04 +++

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to