Last active
June 19, 2018 11:00
-
-
Save samuelbalogh/050b2cf5942f90757690ab161a1e7bef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH invoices_for_cancelled_projects AS | |
(SELECT * FROM invoices, projects | |
WHERE projects.status = 'cancelled' | |
AND invoices.project_id = projects.id) | |
UPDATE invoices_for_cancelled_projects | |
SET invoices.status = 'cancelled' | |
FROM invoices_for_cancelled_projects |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment