I'm trying to create a subselect in the same column, I have to use a column row to get back a new value from the column itself. follow my sql code
SELECT 'idUnidadeOrganica', 'NmUnidadeOrganica', 'idUOSuperior',
(SELECT 'NmUnidadeOrganica' FROM 'unidadeorganica' WHERE 'idUnidadeOrganica' = 'idUOSuperior'),
'SgUF'
FROM 'unidadeorganica';
In the case I am trying to return the name NmUnityOrganica that has your orgUnican id equal to the upper id.