4 messages in com.mysql.lists.win32Re: sql newbie - selcect non-unique| From | Sent On | Attachments |
|---|---|---|
| jds | 03 Mar 2002 10:42 | |
| DL Neil | 03 Mar 2002 13:35 | |
| Rob Spijkerman | 03 Mar 2002 16:43 | |
| Fitch, George A | 04 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,
jd
--------------------------------------------------------------------- Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before posting. To request this thread, e-mail win3...@lists.mysql.com
To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail win3...@lists.mysql.com instead.
------------------------------------------------------------- Rob Spijkerman 27 Nazareth Avenue Database Developer PO Box 8011 Allied Telesyn Research Christchurch Phone +64 3 339 3000 New Zealand DDI +64 3 339 9569 Email: rob....@alliedtelesyn.co.nz Fax +64 3 339 3001 web: http://www.alliedtelesyn.co.nz/
-------------------------------------------------------------




