-1

我有一个表格列表:

select tableList
from information_schema.tables

这些表中的每一个都有一个插入日期。我想获取每个表的 max(insertdate),并将插入日期放在它旁边,例如:

Column1   Column2
table1    MaxInsertDateTable1
table2    MaxInsertDateTable2
table3    MaxInsertDateTable3
table4    MaxInsertDateTable4

有没有办法做到这一点?我正在使用 MPP 数据库:

http://www.actian.com/products/big-data-analytics-platforms-with-hadoop/matrix-mpp-analytics-databases/

4

1 回答 1

0

I would envision a query such as:

select 'table1' as column1, max(insertdate) as column2 from table1 union all
select 'table2' as column1, max(insertdate) as column2 from table2 union all
select 'table3' as column1, max(insertdate) as column2 from table3 union all
select 'table4' as column1, max(insertdate) as column2 from table4;
于 2016-08-02T16:23:51.117 回答