Jim,

You are th bomb!! I figured there was a way to do this via sql, but could
not figure it out for the life of me. Cheers!!


Doug


----- Original Message ----- 
From: "Jim Wright" <[EMAIL PROTECTED]>
To: "CF-Talk" <[email protected]>
Sent: Wednesday, September 27, 2006 2:08 PM
Subject: Re: Help displaying a query result


> Doug Brown wrote:
> > I have a list of categories, and I want to sort them ascending, but I
need to have the category (other) always listed last. Anyone have ideas on
how to accomplish this?
> >
> > IE:
> > Baby Backpacks
> > Baby Carriers and Slings
> > Baby Jumpers
> > Play Pens
> > Vibrating Chairs
> > Other
> >
> > My current query is like so...
> >
> > <cfquery datasource="#request.site.dsn#" name="get_child_categories">
> > SELECT
> >  categories.cat_id,
> >  categories.category,
> >  categories.parent_id
> > FROM
> >  categories
> > WHERE
> >  categories.parent_id =
> >  <cfqueryparam cfsqltype="cf_sql_integer" value="#cat_id#">
> > </cfquery>
> >
> You could do this...
>
> SELECT categories.cat_id,categories.category,categories.parent_id
> FROM categories WHERE  categories.parent_id = <cfqueryparam
> cfsqltype="cf_sql_integer" value="#cat_id#">
> ORDER BY CASE WHEN categories.category = 'Other' THEN 1 ELSE 0 END,
> categories.category
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254541
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