Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

compare rows within same table.

oratechsDec 14 2020

Hi gurus,
How can i compare the rows with in same table and see if they are same. I want to compare the column idcd with in each row of the same table and see if it is repeated, if yes then display another column exist , not exist values.
out put should be something like this.
image.png
with qry as
(
select 123 idord , 15130 idcd ,1 stord from dual union all
select 234,103421, 2 from dual union all
select 345, 15130, 3 from dual union all
select 342, 103421,1 from dual
) SELECT * FROM qry

Comments
Post Details
Added on Dec 14 2020
1 comment
2,729 views