Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Delinda
Constraint Violating Yak Guru
315 Posts |
Posted - 2009-05-18 : 03:28:58
|
I've below table,tblTrnxInfoTrnxID | BankID | AccNo | TrnxAmt-----------------------------------------1 | KLM01 | 1898998 | 249.003 | JUI23 | 1898998 | 244.006 | KLM01 | 1988745 | 224.009 | KLM01 | 1898998 | 256.00tblMyBankBankID | AccNo------------------------------------------KLM01 | 1898998I can query as select t1.TrnxID,t1.BankID,t1.AccNo,t1.TrnxAmtfrom tblTrnxInfo t1 inner join tblMyBank t2on t1.BankID=t2.BankID and t1.AccNo=t2.AccNoTrnxID | BankID | AccNo | TrnxAmt-----------------------------------------1 | KLM01 | 1898998 | 249.009 | KLM01 | 1898998 | 256.00how to adjust my query and it will return others result,TrnxID | BankID | AccNo | TrnxAmt-----------------------------------------3 | JUI23 | 1898998 | 244.006 | KLM01 | 1988745 | 224.00Please help |
|
bklr
Master Smack Fu Yak Hacker
1693 Posts |
Posted - 2009-05-18 : 04:28:52
|
select t1.TrnxID,t1.BankID,t1.AccNo,t1.TrnxAmtfrom tblTrnxInfo t1 left join tblMyBank t2on t1.BankID=t2.BankID and t1.AccNo=t2.AccNowhere t2.bankid is null |
|
|
|
|
|