new_val=$(echo $i | cut -d '.' -f 1)
grep $new_val "/nav/lab/xyz.lst"
begin
DECLARE t_order_id INT;
DECLARE t_not_send INT;
SELECT
o.id,
IF(SUM(IFNULL(rr.return, 0)) != SUM(IFNULL(rr.storage, 0)), 1, 0)
INTO
@t_order_id, @t_not_send
FROM orders o
LEFT JOIN sample_return_product srp ON o.id = srp.order_id
LEFT JOIN return_registry rr ON srp.fin_in_id = rr.fin_in_id
WHERE id = 10
GROUP BY o.id;
INSERT INTO `DUAL` (id,flag) VALUES (@t_order_id, @t_not_send);
UPDATE `orders` SET not_send = @t_not_send WHERE **id = @t_order_id;**
end
工作正常,但INSERT
无效,我不明白为什么。如果UPDATE
中没有WHERE
,则更新查询正常。你能救我吗?