I have a query that I want to combine with another query but without success.
The first query returns all schema names which have the table named status:
select s.schema_name
from information_schema.schemata s
where exists (select *
from information_schema.tables t
where t.table_schema = s.schema_name
and t.table_name = 'status')
In each status table is a column lastLogin which can be selected like this:
select "lastLogin"
from "someID".status
where "lastLogin" is not null
How can I get all values for lastLogin from all status tables from every schema?
Thanks in advance, Doobie