我是新来的,真的需要帮助。解决它几天没有遇到解决方案。我和gammu一起工作。
我有这些表
表格收件箱
+--------------+
| TextDecoded |
+--------------+
|xx200.001,00xx|
|xx300.001,00xx|
+--------------+
表格余额
+-------------+----------------+----------------+------------+
| costumer_id | refill_balance | refill_nominal | status |
+-------------+----------------+----------------+------------+
| 1 | 2000001 | 300.001,00 | verified|
| 1 | 2000001 | 200.001,00 |not_verified|
+-------------+----------------+----------------+------------+
表costumer
+-------------+----------------+----------------+
| costumer_id | name | balance |
+-------------+----------------+----------------+
| 1 | bond | 3000001 |
+-------------+----------------+----------------+
场景是:
我已尝试使用此触发器进行balance.status更新
DELIMITER $$
CREATE TRIGGER verify_refill AFTER INSERT ON inbox
FOR EACH ROW BEGIN
UPDATE balance
SET status='verified'
WHERE refill_nominal=(SELECT balance.refill_nominal FROM balance JOIN inbox ON NEW.inbox.TextDecoded LIKE CONCAT('%',balance.refill_nominal,'%') AND balance.status='not_verified';
END $$
尝试使用此触发器添加costumer.balance
DELIMITER
CREATE TRIGGER add_balance AFTER UPDATE ON balance
FOR EACH ROW BEGIN
UPDATE costumer
SET balance=OLD.balance+NEW.refill_balance
WHERE
costumer_id=NEW.costumer_id
END $$
它们都不起作用。请帮帮我..