时间:2021-07-01 10:21:17 帮助过:2人阅读
2-------update-set和delete-where
原来的表:
update-set:
第一步:
insert into EnglishScores (StuName,Scores,StuId)values(‘牛逼‘,110,‘5‘)
第二步:
update EnglishScores set StuName=‘Tomposn‘ where StuId=5
可以看到,东西已经改变了.
delete-where
delete EnglishScores where StuId=5
-------------------------------------------------------------------------------------
3-----了解分页查询:ROW_NUMBER()over(order by Scores)
--ROW_NUMBER() 就是生成一个有顺序的行号,而他生成顺序的标准,就是后面紧跟的OVER(ORDER BY ID) --还必须添加OVER语句以便告诉SQL Server你希望怎样添加行序号。
-----------------------------------------------------------------------
select * from EnglishScores order by Scores
select * from
(select StuId,ROW_NUMBER()over(order by Scores) as row from EnglishScores) EC//EC是表的别名
where row between 1 and 4
还可以查询多个
1 select * from 2 (select StuId,Scores,ROW_NUMBER()over(order by Scores) as row from EnglishScores) EC 3 where row between 1 and 4
sql-3
标签: