MySql subquery

Not open for further replies.


New Member
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.
Try something like the below, works grand for myself on two separate tables. This will return everything from table 1.
SELECT * FROM tbl1, tbl2 WHERE IF(tbl2.col='value','yes','no')='yes';
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?
Not open for further replies.
Award-winning Mac antivirus and Internet security software