I need to do a SELECT of the resulting table from another SELECT , but I need to reference it in ON INNER JOIN in>. How do I do this in Oracle (PL / SQL)? I tried this way, but it did not work:
SELECT * FROM (SELECT * FROM recurso WHERE tipo = 'CID') AS cidade INNER JOIN hierarquia ON hierarquia.recurso = cidade.codigo;