mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Like expression with case statement error #7471
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cbichis on GitHub (Feb 4, 2025).
Hello,
Its seems a QueryBuilder CASE statement combined with a LIKE is throwing this error:
Error: Expected =, <, <=, <>, >, >=, !=, got 'LIKE'
A similar issue was reported some time ago but only on "Discussions" part of the site, i'll paste here the DQL:
SELECT u, CASE WHEN u.roles LIKE '%ROLE_SUPER_ADMIN%' THEN 'Admin' ELSE '' END AS role
FROM App\Entity\User u
WHERE (CASE WHEN u.roles LIKE '%ROLE_SUPER_ADMIN%' THEN 'Admin' ELSE '' END LIKE :filter0_0)
and I got the error [Syntax Error] line 0, col 936: Error: Expected =, <, <=, <>, >, >=, !=, got 'LIKE'