I want to give a select and instead of receiving the top_default number I want the name of it that is nm_depto. How can I do this?
SELECT d.id_numero_depto, d.nm_depto, d.id_numero_depto_superior FROM tb_depto AS d;
I want to give a select and instead of receiving the top_default number I want the name of it that is nm_depto. How can I do this?
SELECT d.id_numero_depto, d.nm_depto, d.id_numero_depto_superior FROM tb_depto AS d;
I managed, this was the code:
select d1.id_numero_depto, d1.nm_depto, d2.nm_depto from tb_depto d1, tb_depto d2 where d1.id_numero_depto_superior = d2.id_numero_depto and d1.id_numero_depto_superior is not null;