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" Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-12-03, 20:35
DSeltzer DSeltzer is offline
Registered User
 
Join Date: Oct 2003
Location: Fairfield, CT. USA
Posts: 1
Question "Order By" Question

Here's a quick one....

I know the results of a select statement are going to have 3 values. For the sake of argument I'll assume these values will be: 100, 202, 99. How can I ask mysql to sort the output in that order?

-DS
Reply With Quote
  #2 (permalink)  
Old 11-13-03, 02:11
Dylan Leblanc Dylan Leblanc is offline
Registered User
 
Join Date: May 2002
Location: Vancouver Canada
Posts: 26
You could probably do it by using IF() functions on each of the columns you are selecting.

I don't understand the sorting method you are wanting though, could you explain it better?
Reply With Quote
  #3 (permalink)  
Old 11-17-03, 15:02
vanekl vanekl is offline
Registered User
 
Join Date: Nov 2003
Posts: 91
A simple way to make this work is to add a new
column called something like 'SORT_ORDER' that
contains an integer. You can then sort on this 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