I'm new to T-SQL command MERGE
so I found a place in my SQL logic where I can use it and want to test it but can't figure out how exatcly should I use it:
IF (EXISTS (SELECT 1 FROM commissions_history WHERE request = @requestID))
UPDATE commissions_history
SET amount = @amount
WHERE request = @requestID
ELSE
INSERT INTO commissions_history (amount) VALUES @amount)
Plase suggest the proper usage. Thanks!