Avoid Vice versa duplicate Data from table

2932473

    Hi All,

     

    I have a issue with a table while extracting the data, this table consists of duplicate data but in a vice versa Manner( PFA Image for better understanding), i mean two lines of data in the table. But i want only row for data for each duplicate. Kindly suggest best logic or approach to solve this. Thanks in Advance !!

     

     

    Issue.JPG

     

    Regards

    Jeyaprakash

      • 1. Re: Avoid Vice versa duplicate Data from table
        2683628

        can you please provide Oracle version and sample data either in the form of tab/e / insert statements or with a, 'with', select clause.

        Also please provided expected output

        • 2. Re: Avoid Vice versa duplicate Data from table
          2932473

          Hi i got the logic

           

          select *

          from PS_DUP_INV_CMP A

          where exists (select null

                        from PS_DUP_INV_TMP

                          where VOUCHER_ID = A.VOUCHER_ID2

                          and VOUCHER_ID2 = A.VOUCHER_ID

                          and VOUCHER_ID2 > VOUCHER_ID);

           

          this worked and got me the desired results.

           

          Thanks..!!