1、创建测试表,
create table test_order(id number, value1 number, value2 number)
2、插入测试数据
insert into test_order values(1,1001,2001)
insert into test_order values(2,1002,2002)
insert into test_order values(3,1003,2003)
insert into test_order values(4,1004,2004)
insert into test_order values(5,1005,2005)
3、查询表中所有记录数,select t.*, rowid from test_order t,
4、编写sql,按value1字段做升序,按value2字段做降序,
select t.*,
row_number() over(order by value1) rn1,
row_number() over(order by value2 desc) rn12
from test_order t
"order by ITEM_AUTO_ID desc LIMIT "+nowRowNumber+","+DATANUMBERSdesc 降序;asc升序(默认升序)
limit 参数一,参数二;参数一为起始偏移量,参数二为最大行数
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)