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 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%%)
> [...]
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php