1
ipconfiger 2016-11-14 22:31:39 +08:00
讲真, 性别的字段别用 sex 了, 太色情了, 用 gender !
|
2
meta 2016-11-15 02:23:53 +08:00 via iPhone 1
1.为什么每个都要用到,那两个表放的是描述信息,你要显示给人看才会用到,你总不会给人看学号和课程号吧;
2.c 前面少了个 as 。 |
3
bin456789 2016-11-15 03:33:15 +08:00 1
1:
WITH a AS ( SELECT dbo.student.sname , dbo.course.cname , dbo.SC.score , RANK() OVER ( PARTITION BY dbo.SC.cid ORDER BY score DESC ) AS rank FROM SC INNER JOIN course ON SC.cid = dbo.course.cid INNER JOIN student ON student.sid = dbo.SC.sid ) SELECT * FROM a WHERE rank <= 3; 2: WITH a AS ( SELECT * , ROW_NUMBER() OVER ( ORDER BY c ) AS num FROM dbo.T ) SELECT * FROM a WHERE num >= 11 AND num <= 20; |
4
vibbow 2016-11-15 07:25:19 +08:00
@ipconfiger sex 这个用法有错误么?
|
7
heaton_nobu 2016-11-15 10:51:32 +08:00
不用 offset 语句吗
|
8
meta 2016-11-16 23:03:58 +08:00 via iPhone
我不了解 sql server ,有些 dbms 可以省略 as ,但 sql server 能不能省略我不知道,你说你看不懂那个地方,我的意思是加个 as 你就能看懂了。
|