> As an illustration, say that users table has the following entries:
>
> userID_fk [1]
> stationID_fk [4]
> checked [0]
>
> So here, the query will return only the value of the second and forth
> row.
The forth row isn't checked. I'm assuming that's just a typo.
If I'm understanding correctly you need to do a JOIN on the station id and
checked fields. Something like this
SELECT t2.cStationID, t2.customerID_fk, t2.stationID_fk, t2.checked
FROM firstTable t1
INNER JOIN secondTable t2
ON t1.stationID_fk = t2.stationID_fk
AND t1.checked = t2.checked
WHERE t1.userID_fk = 123 --- or whatever the userid is
AND t1.checked = 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:283691
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4