There may be some business requirements that need to compare concatenate strings and column with a given unknown length of the bind variable.
Here is an example SQL that retrieves data from EMPLOYEE and DEPARTMENT tables where employee’s department ID must concatenate two strings before it is compared to an unknown length of variable @dpt_var
select * from employee,department
where concat(concat('A',emp_dept),'B') = @dpt_var
Here the...
How to Tune SQL Statements with CONCAT Operator for MySQL?
Here is an example SQL that retrieves data from EMPLOYEE and DEPARTMENT tables where employee’s department ID must concatenate two strings before it is compared to an unknown length of variable @dpt_var
select * from employee,department
where concat(concat('A',emp_dept),'B') = @dpt_var
and emp_dept= dpt_id
Here the...
How to Tune SQL Statements with CONCAT Operator for MySQL?