|
MySQL query question
ok... I have a little problem.
I want to run a select query. Example:
SELECT DISTICT topic_id
FROM posts
ORDER BY topic_time DESC
now, as expected, the order by doesn' t do anything. (except making the topic id go descending)
but... if i go
SELECT DISTINCT topic_id, topic_time
FROM posts
ORDER BY topic_time DESC
I get the correct sort order, but now i have more than one rows for each topic_id (becuase the topic_time for the topic_id s are different)
So... If you don't get what I said above, I'll try to now explain in just english.
I want to select unique topic_id. However, i want to order them by topic_time. The topic_time for each topic_id is different.
Can anyone help?
__________________
Team 201 - 2003 Great Lakes Semifinalists & 2003 Archimedes Division Finalists :|: Webmaster of www.feds201.com -> FBI Scouting
Winner of The 2003 ChiefDelphi Web Award for: User That Started The Most Non Chit Chat Threads
Winner of: 2003 FIRST Ventures with 5451.68 End Points
All about me: http://knehcsa.vze.com
**Check out the New FIRST Scouting Network**
|