For example, I have this table:
CREATE TABLE perarea
(
id_area INT primary key,
nombre VARCHAR2(200),
id_areapadre INT references perarea(id_area)
);
Instead of showing:
1 IT null
2 Recursos Humanos null
3 Contabilidad 2
4 Legal 2
I want:
1 IT
2 Recursos Humanos
3 Contabilidad Recursos Humanos
4 Legal Recursos Humanos
Any help?
I can't for the life of me figure out how this select would be.
Edit:
This SQL Query works, but doesn't pull the NAME, only the ID of the parent. Any help?
select * from PerArea
connect by id_area = id_areapadre;