I'm using the following query with regexp
:
SELECT a.id, a.company, a.name, b.title, b.description, b.t_id
FROM a, b
WHERE ( b.title
REGEXP "[[:<:]]a.company[[:>:]]" OR b.description
REGEXP "[[:<:]]a.company[[:>:]]" OR b.title
REGEXP "[[:<:]]a.name[[:>:]]" OR b.description
REGEXP "[[:<:]]a.name[[:>:]]" ) AND a.company != '' AND a.name != ''
But, this query is not giving any result nor its giving any syntax error.
When I replace a.company
or a.name
with any of the company name then this query runs fine. Why doesn't this query work with the column names?