Yes, and the "order by" in the SQL is the best method, I believe,
for ordering your output.  It's the method I use all the time.

By default "order by" alphabetizes in ascending order.  In case you
weren't aware of another option, "order by short_desc desc" will
order your output in reverse order.

Rick

> -----Original Message-----
> From: John Barrett [mailto:[email protected]]
> Sent: Sunday, January 11, 2009 11:46 PM
> To: cf-newbie
> Subject: Re: cfquery & alphabetical order
> 
> Hi Paul,
> Thanks so much,and I am happy that I am finally starting to get CF`-`
> 
> John
> 
> On Jan 11, 2009, at 6:01 PM, Paul Kukiel wrote:
> 
> > Looks fine to me this could be shortend
> >
> > <cfoutput query="getKeywords" group="short_desc">
> >   #short_desc#<br /><br />
> > </cfoutput>
> >
> > Paul.
> >
> > -----Original Message-----
> > From: John Barrett [mailto:[email protected]]
> > Sent: Sunday, 11 January 2009 10:27 PM
> > To: cf-newbie
> > Subject: cfquery & alphabetical order
> >
> > Hi,
> > I am wondering what the best way to have a cfquery to become in a
> > alphabetical order. What are the best practice, I don't think that
> > I am
> > using it here. In the SLECT LEFT(column name,number of caharacters)
> > is there
> > a limit on the number of characters? I would prefer to just get the
> > entire
> > cell.
> >
> > Maybe I should not complain, as the code works fine, and does what
> > I what,
> > displays the listing in alphabetical order, but I am trying to
> > learn the
> > best way to do this.
> >
> > Thanks so much,
> > John
> > here is my code:
> >
> > <cfquery name="getKeywords" datasource="my_datsource">
> >   SELECT LEFT(short_desc,100) AS short_desc
> >   FROM senior_links
> >   ORDER BY short_desc
> > </cfquery>
> >
> > <cfoutput query="getKeywords" group="short_desc">
> >   <cfoutput>#short_desc#<br>
> >   </cfoutput><br />
> > </cfoutput>
> >
> >
> >
> >
> >
> >
> >
> 
> 

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

Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4284
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to