After you finish reading about cursors, look for the alternatives and
reasons why cursors hurt your performance :-)

---
Billy Cravens


-----Original Message-----
From: Tim Heald [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, April 24, 2002 3:01 PM
To: CF-Talk
Subject: RE: SQL Booger of a query

Look in the books online at cursors.  I am still only learning them
myself,
but they will allow you to do this.  If you get the SQL below working
let me
know, because that's just cool.

Tim Heald
ACP/CCFD
Application Development
www.schoollink.net

-----Original Message-----
From: Jerry Johnson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 24, 2002 3:54 PM
To: CF-Talk
Subject: Re: SQL Booger of a query


Not actual working code. And probably horrible SQL, but its all I know
how
to do.

That said, it might get you started.

select a.name as gparent, b.name as parent, c.name as child from db as
a, db
as b, db as c
where a.parent=0
and b.parent=1
and b.child=0
and c.grandparent=b.grandparent
and b.grandparent=a.grandparent

Jerry Johnson

>>> [EMAIL PROTECTED] 04/24/02 03:36PM >>>
Explain what you mean

Thanks

Paul Giesenhagen
QuillDesign
http://www.quilldesign.com
SiteDirector v2.0 - Commerce Builder


> Doable?  Implementation depends on your database and structure.
>
> ---
> Billy Cravens
>
>
> -----Original Message-----
> From: Paul Giesenhagen [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 24, 2002 2:14 PM
> To: CF-Talk
> Subject: OT: SQL Booger of a query
>
> I have the following table
>
> Name            Grandparent            Parent            Child
> ========================================
> Fishing            100                        0                    0
> Reels               100                        1                    0
> Baitcast           100                        1                    1
> Spinning           100                        1                    2
> Hunting            200                        0                    0
> Archery            200                        1                    0
> Bows                200                        1                    1
>
> I am going nuts trying to write a query that will give the final
result
> of:
>
> Fishing/Reels/Baitcast
> Fishing/Reels/Spinning
> Hunting/Archery/Bows
> ect...
>
> Is this possible to do in a query?
>
> Any help from you master minds would be helpful... My request was to
not
> have queries within a loop so I am not sure it is doable .. ANY
> suggestions welcome!
>
> Paul Giesenhagen
> QuillDesign
> http://www.quilldesign.com
> SiteDirector v2.0 - Commerce Builder
>
>
>



______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to