|
Delinda
Constraint Violating Yak Guru
315 Posts |
Posted - 05/18/2009 : 03:28:58
|
I've below table,
tblTrnxInfo TrnxID | BankID | AccNo | TrnxAmt ----------------------------------------- 1 | KLM01 | 1898998 | 249.00 3 | JUI23 | 1898998 | 244.00 6 | KLM01 | 1988745 | 224.00 9 | KLM01 | 1898998 | 256.00
tblMyBank BankID | AccNo ------------------------------------------ KLM01 | 1898998
I can query as
select t1.TrnxID,t1.BankID,t1.AccNo,t1.TrnxAmt from tblTrnxInfo t1 inner join tblMyBank t2 on t1.BankID=t2.BankID and t1.AccNo=t2.AccNo
TrnxID | BankID | AccNo | TrnxAmt ----------------------------------------- 1 | KLM01 | 1898998 | 249.00 9 | KLM01 | 1898998 | 256.00
how to adjust my query and it will return others result, TrnxID | BankID | AccNo | TrnxAmt ----------------------------------------- 3 | JUI23 | 1898998 | 244.00 6 | KLM01 | 1988745 | 224.00
Please help |
|
|
bklr
Flowing Fount of Yak Knowledge
India
1693 Posts |
Posted - 05/18/2009 : 04:28:52
|
select t1.TrnxID,t1.BankID,t1.AccNo,t1.TrnxAmt from tblTrnxInfo t1 left join tblMyBank t2 on t1.BankID=t2.BankID and t1.AccNo=t2.AccNo where t2.bankid is null |
 |
|