I started out that way, but couldn't make a join of any type work...
I tried left join, inner join, join, union, etc, but the best I could do
was get one title with one section. There should be one title with
multiple sections.
Here's what I tried last:
select *
from success_stories ss
left join success_sections sss
on ss.story_id = sss.story_id
group by ss.title
order by #arguments.sort# desc
How do I need to modify this to get what I need?
(I've been away from the CF and SQL too long!)
Thanks,
Rick
On Wed, May 27, 2009 at 4:20 PM, Jason Durham <[email protected]> wrote:
>
> There are lots of ways to accomplish that. The simplest way seems to be
> with SQL JOINs and group the output.
>
>
> -----Original Message-----
> From: Rick Faircloth [mailto:[email protected]]
> Sent: Wednesday, May 27, 2009 1:39 PM
> To: cf-talk
> Subject: What's the best way to handle returning two queries from a
> component for looping?
>
>
> Hi, all...
>
> After a *lot* of work in jQuery, specifically AJAX, I'm finally back
> some
> more *friendly* territory
> with CF again as a focus.
>
> Anyway, I'm expanding my ability to use cfc methods and have just run
> into a
> situation where I
> need to do a typical "loop one query to get a title" and "loop another
> query
> inside the first query
> to output details from another query", so I get:
>
> Title 1
> - details 1
> - details 2
> - details 3
>
> Title 2
> - details 1
> - details 2
> - details 3
>
> Instead of:
>
> Title 1
> - details 1
> Title 1
> - details 2
>
> etc...
>
> This is a no-brainer for standard "on-page" queries, but getting the
> info
> back from a method(s) is a little trickier.
> It's a little dark in the room and so far, no light bulbs have come on
> over
> my head...
>
> Do I have to return two queries in a struct? Can I loop the structs as
> I do
> queries? Is this where methods and
> extend other methods come into play?
>
> I read part of a chapter online from one of the CF8 books which seemed
> to
> use a getMetaData function or something
> like that to loop over parts of extended functions...I didn't quite
> understand that brief explanation.
>
> Hoping someone can point me in the right direction...approach to take?
> Tutorial for this?
>
> Thanks for any advice.
>
> Rick
>
> --
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
> --
> "Ninety percent of the politicians give the other ten percent a bad
> reputation." Henry Kissinger
>
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322852
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4