When I create the saved procedure, i can create some variable yes? for example:
CREATE PROCEDURE `some_proc` ()
BEGIN
DECLARE some_var INT;
SET some_var = 3;
....
QUESTION: but how to set variable result from the query, that is how to make some like this:
DECLARE some_var INT;
SET some_var = SELECT COUNT(*) FROM mytable ;
?
See Question&Answers more detail:os