Click here to Skip to main content
15,909,586 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have two table first one is table like structure as follow
1) id
2) debtorName
3) DDNo
4) BankName

and second table as follow structure
1) id
2) PaymentMode
3) DDNo
4) BankName

i want to find the record from table which is not present in table two i use select in command but i got record from only one field but i want found record from two fields
means
in first table there a entry lik
ddno BankName
234 SBI
234 IDBI
in second table a entry like
ddNo BankName
234 IDBI

Now i want to saw only entry which is not in table1 which query i run
Thanks
Posted
Comments
senguptaamlan 28-Aug-10 6:06am    
Did my answer solved Ur problem ???

1 solution

SELECT * FROM table1 WHERE table1.ddno <> (SELECT ddno FROM Table2)

I believe this will work.

Simple isn't ??? :cool:
If this solution work, please mark it as answer
 
Share this answer
 
Comments
sbhhawsar 28-Aug-10 5:31am    
i know it is work but only one field i will check i want with this code one anohter field i.e. bank name
senguptaamlan 28-Aug-10 5:42am    
using AND Clause you can do this something like

SELECT * FROM table1 WHERE table1.ddno <> (SELECT ddno FROM Table2) AND table1.BankName <> (SELECT BankName FROM Table2)
sbhhawsar 28-Aug-10 9:09am    
thanks but
it is i am trying then i post the query
sbhhawsar 28-Aug-10 9:11am    
Reason for my vote of 1
from this no accurate reuslt is come

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900