Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用具有多个表的 Oracle 数据库。我被要求生成一个包含有关这些表的元数据的表,更准确地说,我需要一个包含列 TABLE_NAME(每行显示表的名称)和 NUMBER_COLUMNS(每行显示该表中的列数)的表.
我从 ALL_TABLES 获取有关表名的信息,但我找不到关联甚至找到每个表的列数的方法。我见过的方法,比如这个,只给我一行表格的累积数量。
请帮忙!
你可以这样做:
select table_name, owner, count(*) as Number_Columns from all_tab_cols group by table_name, owner;