with alias as
(
select substr(strip(a.creator) || '.' || strip (a.name), 1, 40) alias
, t.type foTy
, substr(strip(t.creator) || '.' || strip (t.name), 1, 99) for
, t.*
from sysibm.systables t
left join sysibm.systables a
on a.tbCreator = t.creator and a.tbName = t.name
and a.type = 'A'
)
select -- row_number() over () ,
alias.* from alias
where dbName like 'VV%'
-- and alias is null
and type in ('T', 'V')
order by creator, name, alias