Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sql matching

Status
Not open for further replies.

silvafmy

Technical User
Dec 27, 2002
8
0
0
SG
Hi I am wondering whether there is an sql code for the matching criteria below.

I have two tables eg A & B both are similar tables. i need to do a 1 to 1 matching. That is
where table Name A= table Name b
table DR/CR A<> table DR/CR b
table Amount A MINUS table Name b =0

if it matches the &quot;Matched&quot; and &quot;unmatched&quot; status must be updated in the expected result column.Kindly also note that I have many amounts in my tables.


table A

SN Name dr/cr amount Expected Result
1. aaa dr -1000 unmatched
2. aaa cr 1000 matched
3. aaa dr -1000 unmatched
4. bbb cr 1000 matched
5. aaa cr 1000 unmatched
6. aaa dr -1000 unmatched
7. bbb cr 1000 unmatched

table b

SN Name dr/cr amount Expected Result
1. aaa dr -1000 matched
2. aaa dr -1000 unmatched
3. aaa dr -1000 unmatched
4. bbb cr 1000 unmatched
5. bbb dr -1000 matched


Thanks for Helping. God bless.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top