select * from score where cno= '3-105' and degree>109 order by degree desc
select * from 表名 where cno='3-105' and degree>(select top 1 degree from 表名 where cno='3-105' and cno='109') order by degree desc
select * from score where cno='3-105' and degree>(select top 1 degree from score where cno='3-105' and cno='109') order by degree desc
不行!我有答案,就是不明白,请高手指教.select x.sno,x.cno,x.degree from score x,score y where x.cno='3-105'and x.degree>y.degree and y.sno = '109' and y.cno='3-105' order by x.degree desc
select x.sno,x.cno,x.degree from score x,score y where x.cno='3-105'and x.degree>y.degree and y.sno = '109' and y.cno='3-105' order by x.degree desc ----------------- 这个写错了吧 select x.sno,x.cno,x.degree from score score x,score y 这样才可以
你那只是简写,便于饮用,你说是写 score 快,还是写x快啊
为什么最后要“y.cno='3-105'“而“x.cno='3-105'“就不行呢?
select x.sno,x.cno,x.degree from score x,score y where x.cno='3-105' and x.degree>y.degree and y.sno = '109' and y.cno='3-105' order by x.degree desc为什么最后要“y.cno='3-105'“而“x.cno='3-105'“就不行呢? ------------------------------------------------------------- 因为第一个条件已经限制了“x.cno='3-105'”,而同时也要限制“y.cno='3-105'”。
SELECT * FROM 学生表,score s WHERE 学生表.学生号='s.sno' s.cno = '3-105' AND s.degree>109 ORDER BY degree
select sno from score where cno = '3-105' and degree > (select degree from score where name = '109') order by degree
where x.cno='3-105'and x.degree>y.degree and y.sno = '109' and y.cno='3-105'X中 选3--105的 || X成绩大于Y的 || 其中Y的值为y.sno = '109' and y.cno='3-105'的
and degree>109 order by degree desc
select *
from 表名
where cno='3-105' and degree>(select top 1 degree from 表名 where cno='3-105' and cno='109')
order by degree desc
from score
where cno='3-105' and degree>(select top 1 degree from score where cno='3-105' and cno='109')
order by degree desc
score x,score y
where x.cno='3-105'and x.degree>y.degree and y.sno = '109' and y.cno='3-105'
order by x.degree desc
score x,score y
where x.cno='3-105'and x.degree>y.degree and y.sno = '109' and y.cno='3-105'
order by x.degree desc
-----------------
这个写错了吧
select x.sno,x.cno,x.degree from
score score x,score y 这样才可以
score x,score y
where x.cno='3-105'
and x.degree>y.degree
and y.sno = '109'
and y.cno='3-105'
order by x.degree desc为什么最后要“y.cno='3-105'“而“x.cno='3-105'“就不行呢?
-------------------------------------------------------------
因为第一个条件已经限制了“x.cno='3-105'”,而同时也要限制“y.cno='3-105'”。
WHERE
学生表.学生号='s.sno'
s.cno = '3-105'
AND s.degree>109
ORDER BY degree
order by degree