If my table looks like this:
id | colA | colB | colC
===========================
1 | red | blue | yellow
2 | orange | red | red
3 | orange | blue | cyan
Which SELECT query I run so that the returned results:
blue, cyan, orange, red, yellow
Basically, I want to extract a collective list of different values from several columns and return them in alphabetical order.
I'm not interested in performance optimization, because the results are parsed to an XML file that will serve as a cache (the database is unlikely to be updated). So even a dirty decision will be fine.
Thanks for any help!
source
share