Page 1 of 1

Select * Where sortoflikeDistinct(`column`);

Posted: Wed Mar 21, 2007 9:07 pm
by Skara
Er.. I have rows something like:

Code: Select all

324, file1.jpg, park
325, file1.jpg, green
326, file1.jpg, ugly

682, file5.jpg, ocean
683, file5.jpg, green

938, file8.jpg, ocean
Now, I need a query to give me all the different tags (the last row (park, green, etc)).
From the above rows, I would expect back: park, green, ugly, ocean.

Basically, I need a DISTINCT that works on a single column. Is there some way I can do that in the query?

Posted: Wed Mar 21, 2007 10:24 pm
by feyd
select only that column.

Posted: Thu Mar 22, 2007 3:17 am
by mikeq

Code: Select all

SELECT DISTINCT(yourcolumn) FROM yourtable;

Posted: Thu Mar 22, 2007 9:54 am
by Skara
huh. Well. huh. You know, I really don't know what the hell I was thinking. Really.
I guess I thought it would still be distinct per row...

Aaaanyway, thanks!