В моей хранимой процедуре MySQL я хочу сохранить результат приведенного ниже запроса в локальные переменные.
MySQL SP
BEGIN
Declare temp_ID bigint;
Declare temp_teamName Text;
(select ID,team1 from tbl_tournament_matches where leveID = 1 and tournamentID = 91 and matchType = 'L')
UNION
(select ID,team1 from tbl_tournament_matches where leveID = 2 and tournamentID = 91 and looserTeam is not null)
ORDER BY RAND() LIMIT 0,1;
select temp_ID, temp_teamName;
END;
Как передать результат запроса в локальную переменную?примечание: выше SP вернет только 1 строку.