查询表A中成绩分数第3高的记录,至少2个query
表A
P_IDSCORE
1100
299
398
498
597
[解决办法]
select * from (
select SCORE,row_number() over(order by SCORE) as pm from tt )a where pm=3
[解决办法]
select * from 表 where P_ID in (
select P_ID from (
select P_ID,row_number() over(order by SCORE) as ID from 表
) a
where pm=3
)
[解决办法]
select * from 表 where score in (
select score from (
select score,row_number() over(order by SCORE) as ID from 表
) a
where ID=3
)
select * from 表A t
where 3=(select count(*) from 表A where SCORE>=t.SCORE)