hey folks!
i have the followiong table example:
ID----Book-------Category
======================
1 ---- e ------------ b
2 ---- d ------------ b
3 ---- w ------------ a
4 ---- t ------------ a
5 ---- e ------------ c
what i'd like to do is get the Distinct categories, but sort them as they are in the DB, ie: according to the ID, to get this:
b
a
c
but when i write :
"SELECT DISTINCT category FROM tbl ORDER BY ID ASC", i get an error, saying that the "order" clashes with the "Distinct" .
anyone got ideas how to do this>?
thanks!
Snooper
i have the followiong table example:
ID----Book-------Category
======================
1 ---- e ------------ b
2 ---- d ------------ b
3 ---- w ------------ a
4 ---- t ------------ a
5 ---- e ------------ c
what i'd like to do is get the Distinct categories, but sort them as they are in the DB, ie: according to the ID, to get this:
b
a
c
but when i write :
"SELECT DISTINCT category FROM tbl ORDER BY ID ASC", i get an error, saying that the "order" clashes with the "Distinct" .
anyone got ideas how to do this>?
thanks!
Snooper