Tony Gruen wrote:

> first I am running...
> 
> <cfquery name="qGetSpecials" datasource="mydsn">
> select product_id
> from    specials
> </cfquery>
> 
> then I need to get those products that are on special from the main products
> table...here is where i am stuck...
> 
> <cfquery name="qSpecialDetails" datasource="myotherdsn">
> select *
> from products
> where product_id = [i need to get the items from query qGetSpecials above]
> </cfquery>


Why not something like this instead

<cfquery name="qGetSpecialsAndProducts" datasource="mydsn">
SELECT  s.product_id, p.*
FROM    specials s, products p
WHERE  p.product_id = s.product_ID
</cfquery>

Then you can get them all in a single query and iterate that single query
instead of multiple queries.



--

     I don't need $40 million in the bank if it means I have
     someone else telling me what to do.
     
     attributed to John Carmack - id software in Forbes magazine


     email: [EMAIL PROTECTED]
     WWW: http://www.director-online.com/
     
     


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to