SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Return others result
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Delinda
Constraint Violating Yak Guru

315 Posts

Posted - 05/18/2009 :  03:28:58  Show Profile  Reply with Quote
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  Show Profile  Reply with Quote
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
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000