SELECT c.whatever, c.somethingelse, c.cardID
FROM usercards uc, tblcards c
WHERE uc.cardID = c.cardID
AND uc.usersID = <cfqueryparam value="#guserID#"
cfsqltype="cf_sql_integer">
If you need the first query, make a second query if the first returned
something:
SELECT c.whatever, c.somethingelse, c.cardID
FROM tblcards c
WHERE c.cardID IN (<cfqueryparam value="#ValueList(qCards.cardID)#"
cfsqltype="cf_sql_integer" list="yes">)
Pascal
> -----Original Message-----
> From: dave [mailto:[EMAIL PROTECTED]
> Sent: 15 October 2004 08:09
> To: CF-Talk
> Subject: late night query ?
>
> i have a query thats uses a userid to get items out of a db that have
a
> matching userID
> and i need to run another query thats uses those numbers to get
> descriptions outta another table
>
> the basic query is this
>
> <cfquery name="qCards" datasource="#dsn#" username="#un#"
password="#pw#">
> SELECT cardID
> FROM userscards
> WHERE usersID = <cfqueryparam value="#guserID#"
> cfsqltype="cf_sql_integer">
> </cfquery>
>
>
>
> the other tables is called "tblcards" and i need to match the list
from
> the 1st query to get all the descriptions from this one from a field
> called "CardID"
>
> brain is mush, any help?
>
> tia
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

