MySql subquery

Advert test

louie

New Member
#1
I have two tables that are not related in any way because it can not be....

I want to select all the records from the first table but only if a certain field in the second table = 'yes'

Any ideas? I am at it for the last half an hour and can't seem to get any results.
 
#2
Try something like the below, works grand for myself on two separate tables. This will return everything from table 1.
Code:
SELECT * FROM tbl1, tbl2 WHERE IF(tbl2.col='value','yes','no')='yes';
 
#4
That message is saying that while the where clause is valid an empty result set was returned, are you sure the IF statement is pointing to a valid table/column?
 
Top