Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Simplish query problem *SOLVED*

Author  Topic 

MALON
Starting Member

5 Posts

Posted - 2008-05-28 : 00:51:21
First, I'm not sure what format to post the SQL query in, but I'm using it in the Pawn programming language, so it's all on one line. Sorry if it's hard to read :(

Ok, I am supplying you guys with my database that I am having problems with. Basically, I'm telling it to ORDER BY ASC but it's not ordering it correctly. It's almost correct, but not perfect. I'm not sure if SQLite is much different than SQL standard, that's why I differentiate.

Here is the SQLite database:
*deleted*

The problem comes in when you execute this query:

SELECT p.alias, min(s.fin_time), s.cps, s.gcs, s.boosts, s.wpns, s.score, s.score_id FROM climb_scores s JOIN climb_players p ON s.user_id = p.user_id JOIN (SELECT user_id, fin_time, score_id FROM climb_scores WHERE map_name="j2s_4floors" AND cps = 0) g ON g.score_id=s.score_id GROUP BY s.user_id ORDER BY s.fin_time ASC LIMIT 20


The end goal is to have fin_time sorted in ascending order, but it's not working right. Can someone clue me in to the problem?

thanks!

MALON
Starting Member

5 Posts

Posted - 2008-05-28 : 02:13:09
solved. Just add min() around the very last s.fin_time
Go to Top of Page
   

- Advertisement -