I need to select 2 values from 2 fields of 2 tables and compare them.
It has error:
Msg 102, Level 15, State 1, Procedure SP_Transaction, Line 13
Incorrect syntax near '='.
Msg 102, Level 15, State 1, Procedure SP_Transaction, Line 14
Incorrect syntax near ')'.
If ((select sum(amount) as amount from subtransaction where transactionsid=43) =
(select amount from transactions where id=43) and
(select sum(payoutamount) as payoutamount from subtransaction where transactionsid=47 =
(select countervalue from transactions where id=47))
update transactions set status = 3 where id =43
update subtransaction set status = 3 where id =47