Skip to content

Instantly share code, notes, and snippets.

@hugotai101
Created May 6, 2021 09:38
Show Gist options
  • Save hugotai101/6a85cf864d6eeb4f2e212037a0c39745 to your computer and use it in GitHub Desktop.
Save hugotai101/6a85cf864d6eeb4f2e212037a0c39745 to your computer and use it in GitHub Desktop.
Update On join table sql
UPDATE
sales.commissions
SET
sales.commissions.commission =
c.base_amount * t.percentage
FROM
sales.commissions c
INNER JOIN sales.targets t
ON c.target_id = t.target_id;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment