I would like two ID's to be pivoted into the same row based on matching/like PAIR field values. Currently the ID's are just listed in a single column and I am ordering by the PAIR field value.
Below is the query that I am currently running.
select ID,PAIR
from Table
where PAIR in
(select PAIR from Table
where ID in
(select ID
from review
where rule = 1234456
and trunc(RECVDDATE) = trunc(sysdate-1)
)
)
order by PAIR;
ID PAIR
4173910 1175
4423979 1175
4425330 17B5
4106895 17B5
4421153 E54E
3706124 E54E
6 rows selected.
I would like this as my desired result. Basically pivoting the ID based on like/matching PAIR values.
ID(1) ID(2)
4173910 4423979
4425330 4106895
4421153 3706124