View Single Post
  #1   Spotlight this post!  
Unread 01-02-2003, 14:23
Jack's Avatar
Jack Jack is offline
FIRST Scouting Network
AKA: Andrew Schenk
FRC #0201 (The FEDS)
Team Role: Alumni
 
Join Date: Feb 2002
Rookie Year: 2002
Location: Rochester Hills
Posts: 643
Jack is a jewel in the roughJack is a jewel in the roughJack is a jewel in the rough
Send a message via AIM to Jack
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**