标签:sub 新版本 last order by select rom esc version sum
--环比去年 and substr(last_sum.dbilldate,1,4) = to_char(add_months(to_date(substr(tmp.dbilldate,1,7),‘yyyy-mm‘),-12),‘yyyy‘)
row_number() over()取最新版本
select iversion
from so_saleorder
select tmp.pk_order
from (select pk_order,
row_number() over(partition by vbillcode order by nversion desc) as rn
from po_order
where dr = 0
and vbillcode = ‘ vbillcode
‘) tmp
where tmp.rn = 1
select * from ent_contract
--环比去年,row_number() over()取最新版本
标签:sub 新版本 last order by select rom esc version sum
原文地址:https://www.cnblogs.com/tenghao/p/14424320.html