/*Example
(6) 根据借阅表修改每个读者的借书数量。
*/
alter table Reader
drop constraint CK__Reader__borrowCo__1DE57479
update Reader
set borrowCount=alterNum
from Reader a,(
select readerNo,count(readerNo) alterNum
from Borrow
group by readerNo
) b
where a.readerNo=b.readerNo
友情链接:
(1)如何用SQL语句删除check约束
https://zhidao.baidu.com/question/74272804.html
(2)update 子查询使用介绍
https://www.jb51.net/article/53835.htm
(3)SQL子查询在INSERT、UPDATE、DELETE中的应用
https://www.cnblogs.com/lihaoyang/p/8625136.html