March 25th, 2000, 09:21 AM
can someone help me to convert the following
subquery to common inner join statement:
SELECT table1.id, table1.desc FROM table1
WHERE table1.id IN
( SELECT table2.id, table2.desc
WHERE table2.id = table1.id AND
table2.desc LIKE "%keyword%"
the second SQL statement may result multiple rows but i don't want the side effeect which cartesian multiplication generated by inner join, i only want one!
March 25th, 2000, 01:53 PM
select table1.id,table1.desc as desc1,table2.desc as desc2 from table1,table2 where table1.id=table2.id and desc2 like "%keyword%";
Just a quick note, desc is not allowed as a column name in mysql.