LifeinAsia - 5:35 pm on Jul 14, 2010 (gmt 0) [edited by: LifeinAsia at 5:37 pm (utc) on Jul 14, 2010]
SELECT DISTINCT col2, col1 will give you the distinct combinations of col2 and col1, not just col2.
Let's say you have the following:
col1 | col2
apples | red
apples | green
grapes | green
grapes | red
If you just want DISTINCT col2, you will get:
Think about it logically. If you want to show both col2 and col1, there are 2 possible values for each col2- apples and grapes. So it's showing you what you asked for.
[edited by: LifeinAsia at 5:37 pm (utc) on Jul 14, 2010]