Rick, did you want to see
AA
D
C
B
A

or

D
C
B
A
AA

?

On Tue, Aug 26, 2008 at 12:25 PM, Rick Faircloth
<[EMAIL PROTECTED]> wrote:
> Sounds like a good idea to me.
>
> I'll give it a shot.
>
> Thanks,
>
> Rick
>
>> -----Original Message-----
>> From: Dave Phillips [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, August 26, 2008 12:44 PM
>> To: CF-Talk
>> Subject: RE: Here's an interesting little problem...
>>
>> Rick,
>>
>> What database are you using?
>>
>> One thought that comes to mind is to do TWO selects with a UNION and give
>> each their own ORDER BY clause.  Something like this:
>>
>> Select ..... where class NOT in ('A','AA','AAA') ORDER BY class DESC
>> UNION ALL
>> Select ..... where class in ('A','AA','AAA') ORDER BY class ASC
>>
>> You might need some parenthesis around the queries to make it work, not sure
>> which DB you're using.
>>
>> At least that might get you on the right track.
>>
>> I don't think a CASE statement would work in this 'case' (no pun intended),
>> but I've never tried one in an ORDER BY.  Might be worth a shot.
>>
>> Dave
>>
>> -----Original Message-----
>> From: Rick Faircloth [mailto:[EMAIL PROTECTED]
>> Sent: Tuesday, August 26, 2008 11:31 AM
>> To: CF-Talk
>> Subject: Here's an interesting little problem...
>>
>> I need to order query results by class desc.
>>
>> Classes are typically AA, A, B, C, D, etc.
>>
>> Order by class desc puts the AA, A in the correct order,
>> but when all are ordered, I get:
>>
>> D
>> C
>> B
>> AA
>> A
>>
>> The only double letters involved in classes are AA, and AAA.
>>
>> I need a conditional "order by" statement...
>>
>> Order by class desc where class is AA or AAA,
>> otherwise order by class asc
>>
>> Suggestions?
>>
>> Thanks,
>>
>> Rick
>>
>>
>>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311603
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to