I want this in mysql:
SELECT * FROM Table1 Where Field1=searchword
OR Field2=searchword
OR Field3=searchword
OR ((SELECT filedx FROM Table2 WHERE fieldxx = Field1) = searchword)
Where The Field1 in 2nd select is from 1st select statment.
I'm not quite sure what you want, but it looks like you want to match your searchword
against Table1.Field2
, Table1.Field3
and Table2.filedx
. Tables are linked by fieldxx=Field1
. In that case you can do simple outer join:
SELECT * FROM Table1
LEFT OUTER JOIN Table2 ON (fieldxx=Field1)
WHERE
Field1=searchword
OR Field2=searchword
OR Field3=searchword
OR filedx=searchword;
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments