I am trying to setup a few simple SQL scripts to help with some short term DB administration. As such, I\'m setting up variables to try to make it easier to reuse these scri
I resolved using the CONCAT function before using LIKE statement:
SET @email = 'test@test.com'; set @email = CONCAT('%',@email,'%'); SELECT email from `user` WHERE email LIKE @email;
It works fine for me