摘要:
Excel中实现每次加1很方便,比如100,垂直向下的单元格是101,然后是102,103…选中100,101然后向下拉,拉到你想要的那个数字就OK 了。数据库怎么办?比如从100开始到999:一步一步来吧,首先要能生成100到999的数字,用下面这个语句(别试,有问题)declare @num n... 阅读全文
摘要:
一直没实际的需求而使用ntile(),今天看了下,就是按序号分组的意思。还是以student表为例select ntile(3) over (order by score desc) as zu, name, score, provincefrom student... 阅读全文
摘要:
下面把student表添加省份的字段,然后使用partition 按省份内学生成绩排名alter table student add province nvarchar(20);goupdate top (6) student set province='JiangSu';goupdate stud... 阅读全文