| Welcome to WebmasterWorld Guest from 22.214.171.124 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Trouble with DISTINCT|
I thought I understood DISTINCT but I'm doing something wrong (using MySQL).
I have a table with several columns, and I need to return results based on DISTINCT col2. But I need more than just col2 returned...so I tried:
SELECT DISTINCT col2, col1 FROM table WHERE col3 <> '' ORDER BY col3
but this has returned the equivalent of
SELECT col2, col1 FROM table WHERE col3 <> '' ORDER BY col3
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved