Quote:
Originally Posted by nikos101
Code:
SELECT DISTINCT column_name(s)
FROM table_name
|
This is not even helpful. It explains nothing.
Code:
SELECT productid, productname
FROM
products p
,(SELECT DISTINCT catid FROM products) cat
WHERE
p.catid = cat.catid
This might work. It uses a subquery to produce a list of categories, then it finds one product for each category. If it doesn't work, it should give you something to play around with.