zOs/SQL/REOQDBST
-- check sql fuer tDbState
-- #1 zeige ty sta und count
select count(*), ty, sta
from s100447.tDbState
group by ty, sta
;
--# suche Partitions Ueberlappungen
with r as
(
select s.*, rid(s) rid
from s100447.tDbState s
-- where sta <> ''
)
, d as
( select s.*
from r s
where exists (select 1
from r e
where e.rid <> s.rid
and e.ty = s.ty and e.db = s.db and e.sp = s.sp
and (e.paFr = 0 or e.paTo = 0 or s.paFr = 0 or s.paTo = 0
or (e.paFr <= s.paTo and e.paTo >= s.paFr) )
)
)
select * from d
order by db, sp, ty