可以依照SCHEMA展出没有设PK的TABLE def schema_name = &&owner_name col sname format a heading Schema col tname format a heading Table Name select dtowner sname dttable_name tname from sysdba_tables dt where dtowner like upper(&schema_name) escape \ and not exists (select x from sysdba_constraints dc where dcowner = dtowner and dctable_name = dttable_name and nstraint_type = P) order by / 执行结果 Schema Table Name APPLE TEST_TB APPLE KKK APPLE P APPLE PLAN_TABLE APPLE QQ APPLE T APPLE T APPLE T |