zOs/SQL/CATIXRUN

-- indexes und indexPart haben
--     avgKeyLen =-1   iff cardF = -1
--     avgKeyLen = 0   iff cardF =  0
--     avgKeyLen > 0   iff cardF >  0
with g as
(
select smallInt(case when avgKeyLen < 2 then avgKeyLen else 999 end) k,
       smallInt(case when fullKeyCardF < 2 then fullKeyCardF
                     else 999 end) c,
       relCreated,
       statstime
    from sysibm.sysIndexes   p
)
select k, c, count(*),
        min(relCreated), max(relCreated),
        min(statstime), max(statstime)
    from g
    group by k, c
    order by k, c
    with ur
;
with g as
(
select smallInt(case when avgKeyLen < 2 then avgKeyLen else 999 end) k,
       smallInt(case when cardF < 2 then cardF else 999 end) c,
       (select relCreated
            from sysibm.sysIndexes   i
            where i.creator = p.ixCreator and i.name = p.ixName)
            relCreated,
       statstime
    from sysibm.sysIndexPart p
)
select k, c, count(*),
        min(relCreated), max(relCreated),
        min(statstime), max(statstime)
    from g
    group by k, c
    order by k, c
    with ur