Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Been working on this since this morning :

 

Table cProcessComp has:

oldDebtCode:A000000028 NewDebtCode:L000000789

 

Table BKRRPTPF has this :

BKDCOD: A000000028 BKAgency:100

BKDCOD: L000000789 BKAgency:009

 

Now, this SQL should not pick up that row since the BKagencies are not equal but it does pick it up!

 

What am I doing wrong??

select  BKDCOD,NewDebtCode,OldDebtCode,BKAGENCY 
   From BKRRPTPF 
               Inner Join cProcessComp 
                   on  BKDCOD= OldDebtCode   
where   exists ( select * from BKRRPTPF b1 
        inner  join BKRRPTPF b2 
       on b1.BKAgency = b2.BKAgency 
        inner join cProcessComp 
          on b1.bkdcod=newdebtcode and b2.bkdcod=olddebtcode) 

 

I get this row back:

A000000028 L000000789 A000000028 100

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...