Myself trying to pass string variable to where condition in MySQL query as given in this stack overflow answer as given below.
select @start := ' and Id=21';
select * from myTable where 1=1 @start;
So how can I use string variable with where condition in MySQL queries. The variables are set dynamically and the query runs within procedure.
EDIT: I also tried
SET @start = ' Id=21 ';
select * from myTable where (select @start);
But no use.