
我做了以下方法:
select t.列的字段名 from (select ROWNUM As No , M.* from 表名 M) t
where t.No = '3'
就可以了。
这里的M表和T表是一个表,也即是说如果你的表明为A的话,
select t.列的字段名 from (select ROWNUM As No , M.* from A M) t
where t.No = '3'
就可以了。
MYSQL的查询方法select * from a order by b desc limit 2,1
没有验证,应该可以 说下思路吧
先按照b列倒序查询,查询出的数据就是从大到小依次排列的,然后limit2,1意思是从第3条记录开始取一条记录,就是第三个了
ORACLE数据库
select * from(select *,rownum r from a order by b desc) where r=3
Oracle数据库:select b.* from (select a.* ,rownum as vseq from 表名 a where rownum <= 6) b where b.vseq >= 3;SqlServer数据库:select top 6 a.* from 表名 a where a.主键 not in (select top2 b.* from 表名 b)MySql数据库:select a.* from 表名 a limit 3, 3欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)