【MySql】一个未设置成功的触发器
create table aa as
SELECT merchant_no,merchant_name from v2.transaction_detail_202011 where DATE_FORMAT(trans_time,'%d')=30;
create table bb as
SELECT merchant_no,order_no from v2.transaction_detail_202011 where DATE_FORMAT(trans_time,'%d')=30;
create table cc as
SELECT order_no,trans_amount from v2.transaction_detail_202011 where DATE_FORMAT(trans_time,'%d')=30;
create table dd as
SELECT order_no,trans_time from v2.transaction_detail_202011 where DATE_FORMAT(trans_time,'%d')=30;
DELIMITER $
CREATE trigger aabb_delete
on aa
for delete
as
begin
delete bb where merchant_no in (select merchant_no from deleted);
End$
CREATE trigger bbcd_delete
on bb
for delete
as
begin
delete cc where order_no in (select order_no from deleted);
delete dd where order_no in (select order_no from deleted);
End$
DELIMITER ;
CREATE trigger aabb_delete
on aa
for delete
as
begin
delete bb where merchant_no in (select merchant_no from deleted);
End
> 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'on aa
for delete
as
begin
delete bb where merchant_no in (select merchant' at line 2
> 时间: 0s
这个问题只能留着以后再来研究了。先mark一下!