我有一个包含12个表的数据库。为了显示我在每个表中有多少数据,我想做一个查询,在该查询中我收到一个表或一个包含表名及其计数的列表。这是我得到的距离= D。我不知道如何在列表中创建结果,也不知道如何显示相应的名称。
我使用SQL Developer。
(SELECT COUNT(*) FROM CELL_CTRL_PARAMS_INFOS);
(SELECT COUNT(*) FROM ERROR_INFO);
(SELECT COUNT(*) FROM MDE_RESULTS);
(SELECT COUNT(*) FROM PARAMETERS_INFO);
(SELECT COUNT(*) FROM PART_RESULTS);
(SELECT COUNT(*) FROM PRODUCTION_INFO);
(SELECT COUNT(*) FROM STATION_INFO);
(SELECT COUNT(*) FROM STATION_RESULTS);
(SELECT COUNT(*) FROM TEST_INFO);
(SELECT COUNT(*) FROM TEST_RESULTS);
(SELECT COUNT(*) FROM X_PRODUCTION_INFO);
(SELECT COUNT(*) FROM X_STATION_INFO);
答案 0 :(得分:4)
只需选择它们并给它们别名;
SELECT
(SELECT COUNT(*) FROM CELL_CTRL_PARAMS_INFOS) AS CellCtrlParamsInfosCount,
... etc.
答案 1 :(得分:0)
另一种如何制作动态SQL并将所有内容放在一行的方法
get_foo_display