I am new to MySQL. I would like to ask how to pass the result of a select statement to a variable. The variable will then be used in succeeding queries (CASE WHEN
or IF ELSE
).
sample query:
select count(*) from table;
I am new to MySQL. I would like to ask how to pass the result of a select statement to a variable. The variable will then be used in succeeding queries (CASE WHEN
or IF ELSE
).
sample query:
select count(*) from table;
Can use user-defined variables, e.g.:
select count(*) into @itemCount from table;