GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 14-Feb-2005, 08:41
firebird's Avatar
firebird firebird is offline
New Member
 
Join Date: Jan 2005
Posts: 11
firebird is on a distinguished road

Simple SQL Query - ?


I'm running a query that looks like;

"SELECT `uid` FROM `users` ORDER BY `level`, `votes` DESC LIMIT 0,50"

I want to order the users highest level first, and if same level, the user with more votes above the other with the same level. However, if I run this query, I get exactly the opposite (notice I did use DESC). As a matter of fact, nothing changes when I make it 'ASC'.

What's up?
  #2  
Old 16-Feb-2005, 08:52
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Try this and see if you notice anything different:

Code:
"SELECT `uid`, `level`, `votes` FROM `users` ORDER BY `level` DESC, `votes` DESC LIMIT 0,50"
  #3  
Old 16-Feb-2005, 09:00
firebird's Avatar
firebird firebird is offline
New Member
 
Join Date: Jan 2005
Posts: 11
firebird is on a distinguished road
That's it! I had tried something similar to that, although I forgot to put a comma in between..

Thanks!

Quote:
Originally Posted by JdS
Try this and see if you notice anything different:

Code:
"SELECT `uid`, `level`, `votes` FROM `users` ORDER BY `level` DESC, `votes` DESC LIMIT 0,50"
 
 

Recent GIDBlogProgramming ebook direct download available by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DiscountASP.NET Launches SQL Reporting Services dasp Web Hosting Advertisements & Offers 0 19-Oct-2004 18:32
Easy SQL query jlee MySQL / PHP Forum 1 22-Jul-2004 08:15
SQL multiple languages query samtediou MySQL / PHP Forum 6 23-Jul-2003 14:09
Thanx for the sql query, but there must be a little mistake norok MySQL / PHP Forum 13 30-Jun-2003 07:30
Search Engine Positioning 101 and 201 "How To" Tips... 000 Search Engine Optimization Forum 0 29-May-2003 11:34

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 16:23.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.