I have a IBM Content Manager with a DB2 database.
In ICMADMIN, I have a bunch of tables, and some of them contain a specific column (let's call it ID_CLIENT), which is an ID linking to one table (CLIENT).
How can I get the number of rows for each CLIENT from every table containing the ID_CLIENT column?
I know how to retrieve names of every table containing ID_CLIENT, but not how to join CLIENT on them dynamically.
select tabname from syscat.columns where colname='ID_CLIENT'
(let's call this query A)
So my pseudo query would look like:
select count(*) from CLIENT join (A) on CLIENT.ID_CLIENT = (A).ID_CLIENT