I need your help in finding a solution for below issue,
i have a scenario where i have to compare 2 tables derive the status,
table 1 :
here i need to compare the value of 2 table with the ID number to get the value of 650.
Scenario 1: I may get as exact match in table 2 as 650
Scenario 2:i may get exact match in table 2 by summing all the line as 650
Scenario 3:I may get the exact match in table 2 by summing any of the line corresponding to ID 1
here in the above scenario
i need to sum 1st,4th and 5th line to get exact match as 650.
i want help in deriving the 3rd scenario in MYSQL.