1
What you seek is to turn rows into columns, which can be reached through the PIVOT
I made an example for you to achieve your goal:
create table teste (
codigo number,
nome varchar2(50),
uso varchar2(10),
arquivo varchar2(50),
tipo varchar2(50)
);
insert into teste values (10, 'Joao', 'SIM', 'C:JOAO/REALT', 'REALT');
insert into teste values (10, 'Joao', 'SIM', 'C:JOAO/BOLET', 'BOLET');
insert into teste values (10, 'Joao', 'SIM', 'C:JOAO/CHAM', 'CHAM');
Final query:
select * from teste
pivot (
max(arquivo)
for tipo in ('REALT' as REAT,
'CHAM' as CHAM,
'BOLET' as BOLET
));
Search by PIVOT http://www.oracle.com/technetwork/pt/articles/sql/principais-caracteristicas-database-21083-ptb.html and CASE http://stackoverflow.com/questions/4841718/oracle-sql-pivot-query
– Motta