use library;
######### Begin #########
## -- 12、在USER表中添加一个金额字段amount,类型decimal。并对每个用户的交费总额进行修改
alter table Users add amount decimal;
update Users,(select sum(amount) as amount,loanNo from Money group by loanNo ) as t
set Users.amount=t.amount
where Users.loanNo=t.loanNo;
######### End ##########
select loanNo,lname,amount from Users where amount is not NULL order by loanNo;
educoder第3关:任务3:CTGU实验3_4-查询12
最新推荐文章于 2023-04-07 09:23:54 发布