I figured out what I needed to do. Took some time, but it's working.

Thanks.




-----Original Message-----
From: rudy [mailto:[EMAIL PROTECTED]]
Sent: April 22, 2002 4:38 PM
To: [EMAIL PROTECTED]
Subject: Re: [CFTALKTor] CFLOOP and LISTS


> Still learning SQL, so I'm not sure how to go about this.

hi arun

that's okay, just realize that you are making some pretty basic errors, and
please don't take the replies you get as derogatory   ;o)

>  SELECT Table1.*, Table2.*
>     FROM Table1, Table2
>   WHERE Table1.category LIKE '%#category#%'
>       AND Table2.category LIKE '%#category#%'

there's still a problem here -- if table 1 has 15 rows where the category
contains dog, and table 2 has 35 rows where the category contains dog, then
your answer will contain FIVE HUNDRED AND TWENTY FIVE rows, because you
don't have a join condition

as for doing query in a loop, this should be avoided if at all possible

sometimes it's unavoidable, such as when you are inserting multiple rows
from an input form -- mysql has some useful (if non-standard) syntax for
inserting multiple rows in a single INSERT VALUES statement, but that's not
your problem here

you should never return the results of one query to your CF code in order
to insert them into another table

look up the INSERT SELECT syntax

rudy

-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "rudy" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Arun Persaud" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)

Reply via email to