根据fcustno分类,按ftime排序(不同的fcustno,fnum从1开始算)
取fcustno和对应的最大ftime:
select * from ( SELECT FCUSTNO,FTIME,row_number() over(partition by FCustNo order by FTIME desc) fnum from tableName ) where fnum=1;
自定义排序
select * from tableName where colName in(1, 2, 3) order by decode(colName, 2, 1, 1, 2, 3);
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/279924.html