Quantcast
Viewing all articles
Browse latest Browse all 73760

check duplicate record fields from 2 table using join and while select statement

HI everyone,

I have  a project that I am stuck with, I need to retreive data from 2 tables as follows:

tableA has filed commisson_number also tableB has field commisson_number I am able to join these two tables on puchId and retreive 16 records.  Now once this is done I need to check for duplicates from those 16 records any ideas how to do this?  I have the following code so far:

I need to check how many duplicate commission number on tableB per purchId as purchId is the commone field between the 2 tables.

 

static void Job11(Args _args)
{
    TableA              tableA;
    TableB              tableB;
    PurchStatus             ps;
   
   

    ;


    while select tableA where tableA.CommissionNum != ' ' && tableA.PurchStatus!=PurchStatus::Invoiced
    join tableB where tableB.PurchId == tableA.PurchId && tableB.CommissionNum > '0'


    {



        info(strfmt("data from tableA: %1", tableA.CommissionNum));


        ps = TableA.PurchStatus;

        info(strfmt("purch status '%1'",enum2str(ps)));

       



    }


}


Viewing all articles
Browse latest Browse all 73760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>