SQL Join - Select DISTINCT rows headache
Posted on 2009-05-14
I've got a table as follows with Id's and Colours.
In the table there are multiple Colours with different Ids.
I want a query to produce just distinct colours, with any Id that is associated with it.
I've tried DISTINCT, but because the IDs are always different that doesn't work.
I have a feeling I need to JOIN it on itself, somehow, with a GROUP BY statement on the colour. But as soon as I add the GROUP BY, it needs the ID included, which destroys the GROUP BY.
Could anyone give me a point in the right direction?