Quantcast
Channel: Go4Expert
Viewing all articles
Browse latest Browse all 1987

How to Tune SQL Statements with CONCAT Operator for MySQL?

$
0
0
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
and emp_dept= dpt_id​

Here the...

How to Tune SQL Statements with CONCAT Operator for MySQL?

Viewing all articles
Browse latest Browse all 1987

Trending Articles