SELECT DISTINCT(LEFT (product_number,5)) FROM products.
http://www.mysql.com/doc/en/String_functions.html hth Jeff Personal <[EMAIL PROTECTED] To: [EMAIL PROTECTED] .net> cc: Subject: SELECT DISTINCT question 10/13/2003 12:38 PM Hello everybody: I have the following scenario: I have a database of products, each of those products have a product number (like 04543000). Now the first five digits represent the product number, and the 2 following digits represent a differet color for the same product. Now I have to show the thumbnails of this products but only for one color. So my query should look something like this: SELECT DISTINCT(product_number) FROM products. Now this query will return all the different product numbers i.e. but it will also return the different colors as a different product number. Is there anyway to have a query like: SELECT DISTINCT(first_five_product_numbers) FROM products? I can find the solution to it. Maybe the solution will be more experience :) But maybe the solution can be the list. Thanks, Hector -- 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]