4 messages in com.mysql.lists.win32Re: sql newbie - selcect non-unique
FromSent OnAttachments
jds03 Mar 2002 10:42 
DL Neil03 Mar 2002 13:35 
Rob Spijkerman03 Mar 2002 16:43 
Fitch, George A04 Mar 2002 10:32 
Subject:Re: sql newbie - selcect non-unique
From:Rob Spijkerman (rob.@alliedtelesyn.co.nz)
Date:03/03/2002 04:43:54 PM
List:com.mysql.lists.win32

If you want to see the double entries it is best to use a temporary table creating one as the parent and one as the child and then viewing those that repeat.

CREATE TEMPORARY TABLE tmp( <field_names>) TYPE = HEAP;

insert the data you want to compare and then

SELECT parent.id FROM tmp as parent, tmp as child WHERE parent.fieldname = child.fieldname AND parent.otherfieldname = child.otherfieldname AND parent.id > child.id GROUP BY child.id;

This will then display all the double entries.

From: "jds" <jond@mn.rr.com> To: <win@lists.mysql.com> Subject: sql newbie - selcect non-unique Date sent: Sun, 3 Mar 2002 12:43:13 -0600

hi. i'm totally new to sql and rdbs---

i'm trying to discern where duplicates exist amongst 70000 or so records.

i want to somehow....

SELECT * FROM Product_attributes WHERE ID IS NOT UNIQUE;

now, i know this is not correct usage of unique - i would have to SELECT NONUNIQUE or something of that sort...

thanks in advance,

-------------------------------------------------------------