Guess you can do that too ;-)  I like it better in some ways than the case
(it's easier to create a dynamic list), though the case statement would be
easier to read...

/*-----Original Message-----
/*From: Greg Morphis [mailto:[EMAIL PROTECTED]
/*Sent: Tuesday, August 26, 2008 2:42 PM
/*To: CF-Talk
/*Subject: Re: Here's an interesting little problem...
/*
/*Yeah but you can do the same with a case statement... which was
/*introduced in Oracle 9i..
/*Plus there's no reason to select it unless you intend on using it later.
/*Just do
/*
/*select class from classes
/*order by decode(lower(class),'aa',1,'a',2,...)
/*
/*just FYI
/*
/*On Tue, Aug 26, 2008 at 2:31 PM, Eric Roberts
/*<[EMAIL PROTECTED]> wrote:
/*> There is also a way in Oracle(just for reference)...you can used
/*decode() to
/*> do this (not sure if any of the other db's have this or a similar
/*function).
/*>
/*> You would add decode(class,'aa',1,'a',2,'b',3...,/default value/) as
/*> sort_order in the select statement then in the order by, order by
/*sort_order
/*>
/*> Eric
/*>
/*> /*-----Original Message-----
/*> /*From: Rick Faircloth [mailto:[EMAIL PROTECTED]
/*> /*Sent: Tuesday, August 26, 2008 2:10 PM
/*> /*To: CF-Talk
/*> /*Subject: RE: Here's an interesting little problem...
/*> /*
/*> /*It's already in the mail!  :o)
/*> /*
/*> /*I definitely put yours and Steve's solutions
/*> /*in my snippets.  Steve's will work when value length
/*> /*is a determinant, but yours will work in any "case".  :o)
/*> /*
/*> /*Rick
/*> /*
/*> /*
/*> /*> -----Original Message-----
/*> /*> From: Charlie Griefer [mailto:[EMAIL PROTECTED]
/*> /*> Sent: Tuesday, August 26, 2008 2:44 PM
/*> /*> To: CF-Talk
/*> /*> Subject: Re: Here's an interesting little problem...
/*> /*>
/*> /*> i'm not givin' back my prize.
/*> /*>
/*> /*> On Tue, Aug 26, 2008 at 11:38 AM, Rick Faircloth
/*> /*> <[EMAIL PROTECTED]>wrote:
/*> /*>
/*> /*> > And we have another winner!  Steve!
/*> /*> > With an even faster way to skin the cat. (My apologies
/*> /*> > to my cat, Maggie...)
/*> /*> >
/*> /*> > <cfquery name="get_results" datasource="#application.dsn#">
/*> /*> >
/*> /*> >     select     t.name, t.date, t.time,
/*> /*> >                s.firstname, s.lastname, s.state, s.nsca,
/*> /*> >                r.con, r.class, r.shot, r.broke
/*> /*> >     from       tournaments t, shooters s, registrations r
/*> /*> >     where      r.shooter_id = s.shooter_id
/*> /*> >      and        r.tournament_id = t.tournament_id
/*> /*> >     and        t.tournament_id = <cfqueryparam cfsqltype="integer"
/*> /*> > value="#url.tournament_id#">
/*> /*> >      order by   length(class) desc, class
/*> /*> >
/*> /*> > </cfquery>
/*> /*> >
/*> /*
/*> /*
/*> /*
/*> /*
/*>
/*>
/*
/*

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:311631
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to