我刚刚研究了Mysql存储过程。我试图创建一个数组,并使用循环来处理数组中的每一行,就像PHP中的Foreach一样,但是如何在Mysql存储过程中使用它
BEGIN
DROP TEMPORARY TABLE IF EXISTS final_late;
CREATE TEMPORARY TABLE final_late(staff_id int, total_late_count int, total_late_time int, month int, year int);
SET @work_staff = 'SELECT * FROM work_staffs WHERE staff_id = p_staff_id';
//example i want
WHILE (@work_staff as item) DO
//How to get row item like foreach in php (in php: item->column)
END WHILE;
END