I have a non-working query as the sub-query FROM
clause doesn't understand CONCAT()
:
SELECT *
FROM `events` e
WHERE EXISTS (SELECT *
FROM CONCAT('prefix_', e.`event_id`) registrations
WHERE registrations.`attendee` = 123456
)
Is there any way to make this work in a single-statement?
The error message I receive is:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '('prefix_', e.event_id) registrations