select NVL(sum(case when create_date_time>=to_date('2014-11-24 00:00:00','yyyy-mm-dd hh24:mi:ss') and create_date_time<=to_date('2014-11-24 23:59:59','yyyy-mm-dd hh24:mi:ss') then amount end),0) today ,NVL(sum(case when create_date_time>=to_date(…
SELECT COUNT(case when f.fileState=2 then 0 end) as fixed,COUNT(case when f.fileState=3 then 0 end) as Issue,COUNT(case when f.fileState=5 then 0 end) as decrypt FROM File f…
select * from aa01_2014 where aaa001=(select c.p from (select aaa001,lag(aaa001,1,0) over (order by aaa001) as p from aa01_2014) c where c.aaa001='8a9299ec522f54f401522f81eedc0007') ; select * from aa01_2014 where aaa001=(select c.n from (select aa…
sql在不同数据库查询前几条数据 1. ORACLE SELECT * FROM TABLE_NAME WHERE ROWNUM <= N; HQL: from table_name t order by t.create_time desc where rownum<=n; 2. postgres查询前几条记录SQL SELECT * FROM TABLE_NAME LIMIT N; 3. DB2 SELECT * ROW_NUMBER() OVER(ORDER BY COL1 DESC…