I´d like to SELECT a single value into a variable. I´d tried to following:
DECLARE myvar INT(4);
-- immediately returns some syntax error.<
Per the MySQL docs DECLARE works only at the start of a BEGIN...END block as in a stored program.