When selecting a MySQL variable which contains a concatenation of a select statement and another variable like so:
SET @sql_q1 := (CONCAT('(SELECT "Q1" AS quartile,
visit.id FROM carecube.visit order by visit.id LIMIT 1 OFFSET ', @var, ')'));
Why so, when I select this, why does it return the select statement as text rather than a value?
Thanks.
EDIT: When I run the following select statement to select the variable, it just prints the select statement within the variable and prints out
'SELECT "Q1" AS quartile, visit.id FROM carecube.visit order by visit.id LIMIT 1 OFFSET 58'
I assumed I would get a number returned, offsetting after the 58th row and not the text.
MySQLis the DBMS andsqlis the language. No conflict.