I get this error when attempting the query below. I have a table called access_groups, one called companies, and a join table called access_group_companies. I'm trying to run a search with AND logic using fields in companies.name and access_groups.name. Any idea what is causing this? And if you might know of a better way to run this search, that would be great.
SELECT ag.id, ag.name, c.name
FROM access_groups ag,
companies c
JOIN ag ON ag.id = access_group_companies.access_group_id
WHERE CONCAT(ag.name, c.name) LIKE '%ВТБ%';