对,用rownum; select * from (select * from tbname order by 列名 desc/asc) where rownum<=10;
<b>原来只有rownum啊 </b>
没有啊,只有rownum select * from (select rownum num,a.* from tbname a order by 字段名 desc/asc ) where rownum<=10;
供参考: select phone from T_Payphonestate where state=0 and yearmonth in (select * from (select distinct yearmonth from T_Payphonestate order by yearmonth desc) where rownum<4) group by phone having count(*)>=3
select * from (select * from tbname order by 列名 desc/asc) where rownum<11;
/
select * from (select * from tbname order by 列名 desc/asc) where rownum<=10;
select * from (select rownum num,a.* from tbname a order by 字段名 desc/asc ) where rownum<=10;
select phone from T_Payphonestate where state=0 and yearmonth
in (select * from (select distinct yearmonth from T_Payphonestate order by yearmonth desc) where rownum<4)
group by phone having count(*)>=3