【发布时间】:2018-02-28 14:33:37
【问题描述】:
我有一个查询要与另一个查询合并,但没有成功。
第一个查询返回表名为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')
在每个状态表中有一个列lastLogin,可以这样选择:
select "lastLogin"
from "someID".status
where "lastLogin" is not null
如何从每个模式的所有状态表中获取 lastLogin 的所有值?
提前致谢,杜比
【问题讨论】:
标签: postgresql select