是否可以在存储过程或触发器内的单个查询中返回多个行和列?以及如何获取要返回的数据?我需要使用循环或其他东西吗?
这就是我想要的:
DROP TRIGGER IF EXISTS `trgg`;
DELIMITER ;;
CREATE TRIGGER `trgg` AFTER INSERT ON tbl
FOR EACH ROW BEGIN
SET @result = (SELECT * FROM tbl2 WHERE field = 1 );
// i want to fetch the values return @result, is that possible?
// Or at least only the column only, not necessarily all the rows,
#### rest of the codes goes here #####
END ;;
我已经研究了大约一天,但我仍然找不到答案,这里有没有人可以帮助我