Last active
August 29, 2015 14:02
-
-
Save brandon-beacher/a01a01e608834daa6038 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
update events | |
set reminded = all_invitees.all_reminded | |
from ( | |
select all(reminded) as all_reminded | |
from invitees | |
where invitees.event_id = events.id) as all_invitees |
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
update events | |
set reminded = all_invitees.all_reminded | |
from ( | |
select event_id, bool_and(reminded) as all_reminded | |
from invitees | |
group by event_id) as all_invitees | |
where events.id = all_invitees.event_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment