My question seems to be quite simple, but I'm worried the answer might actually be somewhat complex. I am trying to perform a simple Select query that behaves like the following.
Here is the code:
SELECT * FROM tbl_tbl WHERE tbl_tbl.colA LIKE '%foo%' OR tbl.tbl.colA LIKE '%oof%' AND
tbl_tbl.colB LIKE '%bar%' OR tbl_tbl.colB LIKE '%rab%'
You would express it using parentheses and boolean logic in the
SELECT * FROM tbl_tbl t WHERE (t.colA LIKE '%foo%' OR t.colA LIKE '%oof%') AND (t.colB LIKE '%bar%' OR t.colB LIKE '%bar%');
Do note that this is based on your example in the question. The second clause of the
AND has two conditions that are the same. I assume this is a typo in the question, but not knowing the right pattern, I've left it in the answer.