我有一个存储过程,我想GROUP BY
在这样的FOREACH
语句中使用:
FOREACH SELECT a.task_code, a.task_name, MAX(a.cand_num)
FROM (SELECT DISTINCT a.task_code, a.task_name, 0 as cand_num
INTO ll_task_code, ls_task_name, ll_cand_num
...........
...........
) AS u
GROUP BY a.task_code, a.task_name
RETURN ll_task_code, ls_task_name, ll_cand_num WITH RESUME;
END FOREACH;
但我得到一个语法错误into ll_task_code, ls_task_name, ll_cand_num
怎么GROUP BY
用 FOREACH
?