根据下面给的表和 SQL 语句,问执行 SQL 语句更新多少条数据?
发布于 2022-03-03 11:06:25
根据下面给的表和 SQL 语句,问执行 SQL 语句更新多少条数据?sql 语句:
update Books set NumberOfCopies = NumberOfCopies + 1 where AuthorID in select AuthorID from Books group by AuthorID having sum(NumberOfCopies) <= 8
表中数据:
BookID Tittle Category NumberOfCopies AuthorID
1 SQL Server 2008 MS 3 1
2 SharePoint 2007 MS 2 2
3 SharePoint 2010 MS 4 2
5 DB2 IBM 10 3
7 SQL Server 2012 MS 6 1
update Books set NumberOfCopies = NumberOfCopies + 1 where AuthorID in select AuthorID from Books group by AuthorID having sum(NumberOfCopies) <= 8
表中数据:
BookID Tittle Category NumberOfCopies AuthorID
1 SQL Server 2008 MS 3 1
2 SharePoint 2007 MS 2 2
3 SharePoint 2010 MS 4 2
5 DB2 IBM 10 3
7 SQL Server 2012 MS 6 1
登录后免费查看答案
关注者
0
被浏览
29