RE: How do I find duplicate records?

2002-05-01 Thread Jay Blanchard
[snip] Thank you for the email. Following is the php code but it doesn't work. ? include (connect_my_db.inc); connect_my_db(); $result = mysql_query (SELECT DISTINCT id FROM my_rank WHERE rank='a'); while ($row = mysql_fetch_array($result)) { $id = substr($row[id], 0, 8); $query =

Re: How do I find duplicate records?

2002-05-01 Thread Bill Easton
Try: select substring(id,1,8) as pfx from foo group by pfx; or, if the column is numeric: select floor(id/100) as pfx from foo group by pfx; Date: Tue, 30 Apr 2002 12:59:05 -0700 (PDT) From: James Dellacova [EMAIL PROTECTED] Subject: How do I find duplicate records? [...] I

How do I find duplicate records?

2002-04-30 Thread James Dellacova
Hi All, I have over 68,000 records in a table with unique ID field that has 10 chars. Need to create a query to find all matching or duplicate IDs up to 8 chars. (Eg. 12345678%%) Can anyone help me? Thanks in advance for any comments. James

RE: How do I find duplicate records?

2002-04-30 Thread Jay Blanchard
[snip] I have over 68,000 records in a table with unique ID field that has 10 chars. Need to create a query to find all matching or duplicate IDs up to 8 chars. (Eg. 12345678%%) Can anyone help me? [/snip] Try select ID from tblFOO group by ID having count(*) 1 HTH! Jay Blanchard

RE: How do I find duplicate records?

2002-04-30 Thread James Dellacova
Thank you for the email. Following is the php code but it doesn't work. ? include (connect_my_db.inc); connect_my_db(); $result = mysql_query (SELECT DISTINCT id FROM my_rank WHERE rank='a'); while ($row = mysql_fetch_array($result)) { $id = substr($row[id], 0, 8); $query = SELECT