Originally Posted by nikos101
SELECT DISTINCT column_name(s)
This is not even helpful. It explains nothing.
SELECT productid, productname
,(SELECT DISTINCT catid FROM products) cat
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.