[thelist] SQL order by

Joshua Olson joshua at waetech.com
Fri Feb 7 09:14:00 CST 2003


----- Original Message -----
From: "Drew Shiel" <ashiel at sportsinteraction.com>
Sent: Friday, February 07, 2003 10:03 AM


> Even if I remove the "ORDER BY" part, the results come out in numeric
> order. Is there any way to preserve the order I have set (6,5,7, etc)?
>
> (The order isn't very different in this version, and it's not frightfully
> urgent. In future versions, however, I may want vastly different ones,
like
> 17,2,5,11,6... )

Drew,

Asking the database to do this may be a little more taxing than you may have
hoped.  Here's one possible approach:

Insert the values into a temporary table that has an identity field.  Then,
add this temp table into the join and order by the identity field.

If you don't want to do that, then you may consider handling the resort on
the scripting page.  What is your scripting language of choice?  CF, ASP,
PHP, ??




More information about the thelist mailing list