Closed jhickner closed 8 years ago
How would I construct an update that includes a join? In SQL it looks like this: update users u set flag = false from roles r where r.user_id = u.id
update users u set flag = false from roles r where r.user_id = u.id
This actually compiles but results in a sql error:
update $ \u -> do set u [UserFlag =. False] from $ \r -> where_ (r ^. RoleUserId ==. u ^. UserId)
I don't think you can do that today. You may want to try the equivalent of:
UPDATE users u SET flag = false WHERE u.id IN (SELECT user_id FROM roles)
How would I construct an update that includes a join? In SQL it looks like this:
update users u set flag = false from roles r where r.user_id = u.id
This actually compiles but results in a sql error: