If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Order by+DESC and negative number

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-17-04, 14:38
digital_storm digital_storm is offline
Registered User
 
Join Date: Dec 2003
Posts: 28
Order by+DESC and negative number

Hello,

I have a little problem that I would be glad if someone could help me to solve.

I have a table with a number of players, in that table I have all players scores and game difference.

If I do a:" SELECT* FROM player ORDER BY points DESC, gamediff DESC"
I get:
name points goaldiff
playerA 10 15
PlayerB 8 10
PlayerC 6 -5
PlayerD 6 -4

This is wrong in ordinary mathematic because "-5" is less than "-4"
Can I do anything to overcome this problem?

Thanks in advance!

// D_S
Reply With Quote
  #2 (permalink)  
Old 05-17-04, 15:02
guelphdad guelphdad is offline
Registered User
 
Join Date: Mar 2004
Posts: 440
probably your goaldiff column is a character column instead of an int column.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On