Pity you are not on V8.1 where the following would work (change mod()=1 to mod()=0 for even rows):
- select *
-
from table(select row_number() over () as rnum, tabschema, tabname
-
from syscat.tables) x
-
where mod(rnum,2) = 1
However, if your tables are not too large, try:
- SELECT *
-
FROM (SELECT rtrim(t.tabschema) || '.' || t.tabname as key,
-
count(*) as rnum
-
FROM syscat.tables t,
-
syscat.tables t1
-
where rtrim(t.tabschema) || '.' || t.tabname >=
-
rtrim(t1.tabschema) || '.' || t1.tabname
-
group by rtrim(t.tabschema) || '.' || t.tabname) as x
-
where mod(rnum,2) = 1