我可以使用这种查询来查看具有行数的表名:
SELECT table_name, table_rows
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'FirstDB';
如果SecondDB具有相同的表,我希望看到其他列“ second_table_rows”,并且我还希望在底部具有SecondDB的所有唯一表。
所以我想要这样的东西:
---------------+-------------------+--------------------+
table_name + rows_in_firstDB + rows_in_secondDB +
---------------+-------------------+--------------------+
onlyinFirst + 100500 + null +
---------------+-------------------+--------------------+
bothDBtable1 + 100500 + 100500 +
---------------+-------------------+--------------------+
---------------+-------------------+--------------------+
bothDBtableN + 100500 + 100500 +
---------------+-------------------+--------------------+
onlyinSecond + null + 100500 +
---------------+-------------------+--------------------+