with temptable(COMCODE,UPPERCOMCODE,Validstatus)
as
(select root.COMCODE,root.UPPERCOMCODE,root.Validstatus
from PRPDCOMPANY root where root.COMCODE=''
union all
select sub.COMCODE,sub.UPPERCOMCODE,sub.Validstatus
from
PRPDCOMPANY sub,
temptable super
where sub.UPPERCOMCODE=super.comcode
and sub.comcode<>super.UpperComCode
and sub.Validstatus = '1')
select COMCODE from temptable ORDER BY ComCode
DB2的with
最新推荐文章于 2018-05-15 14:20:43 发布