如何用触发器修改数据?
create table 商品
(商品编号 char(10) not null constraint pk_spbh primary key,
厂商编号 char(10) not null constraint fk_csbh foreign key (厂商编号) references 厂商(厂商编号),
商品类型编号 char(10) not null constraint fk_splxbh foreign key (商品类型编号) references 商品类型(商品类型编号),
商品名称 varchar(30) constraint uk_spmc unique,
商品单价 float,
商品数量 int,
库存位置 varchar(10),
是否终止 bit
)
create table 订单明析
(
商品编号 char(10) not null constraint fk_spbh foreign key (商品编号) references 商品(商品编号),
订单编号 char(10) not null constraint fk_ddbh foreign key (订单编号) references 订单(订单编号),
单价 float,
数量 int,
折扣 char(10)
)
想在查出当商品的数量(只在订单明析中的数量比较)为最少时(不管时间),把它销售的价格给改少,然后再出售,因为这商品的销售量低嘛~所以我们就改价格,让它尽量销售出去啊 ~先说声谢谢了啊,各位前辈