当前位置:Gxlcms > mysql > mysql数据库,workbench,报错,sql格式错误?

mysql数据库,workbench,报错,sql格式错误?

时间:2021-07-01 10:21:17 帮助过:49人阅读

mysqlworkbenchsql建数据库

建立数据库是卡住了
代码如下,最后三行的前面出来红色的×。
请问,什么问题?
begin
if new.item_type_id<> old.item_type_id
or new.measure_type_id <> old.measure_type_id
or new.per_quantity<> old.per_quantity
or new.total_weight<> old.total_weight
or new.unit_price<> old.unit_price
or new.enabled_flag <> old.enabled_flag then
insert into mtl_item_price_his
set item_id =old.item_id
,change_date =now()
,unit_price=old.unit_price
,item_type_id=old.item_type_id
,measure_type_id =old.measure_type_id
,per_quantity=old.per_quantity
,total_weight=old.total_weight
,description =old.description
,creation_date =now()
,created_by=old.last_updated_by;
END if;
end;

人气教程排行