Auto Relacionamento
Enviado: Qua, 29 Nov 2006 4:45 pm
Srs . alguém teria algum exemplo de Auto Relacionamento.
Agradeço mais uma vez !!!
Agradeço mais uma vez !!!
glufke.net - Dicas, truques e boas-práticas sobre a tecnologia Oracle, Forms, Reports, SQL, Tunning e muito mais!!
https://glufke.net/oracle/
EMPREGADO NOME CHEFE
--------- ----------- -----
10 JOAO 40
20 PEDRO 40
30 CARLOS 40
40 THE BOSS
alter table EMPREGADOS
add constraint EMPR_EMPR_FK foreign key (CHEFE)
references EMPREGADOS (EMPREGADO);
select a.table_name
from user_constraints a
where exists (select 1
from user_constraints b
where a.constraint_name=b.r_constraint_name
and a.table_name =b.table_name)