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