CREATE OR REPLACE FORCE VIEW "PLANTA_PK_COLUMNS_UNUSED_BY_FK" ("ID", "NAME", "TABLE_ID", "DB_POS", "SQL_FLAGS") AS 
select "ID","NAME","TABLE_ID","DB_POS","SQL_FLAGS" from planta_pk_columns pk
where not exists (
	select 1 from planta_fk_columns fk
	where fk.table_id = pk.table_id
	and fk.name = pk.name
) order by pk.table_id asc, pk.db_pos asc;/
