By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
1 rows affected
1 rows affected
1 rows affected
1 rows affected
1 rows affected
1 rows affected
ERROR: invalid reference to FROM-clause entry for table "u"
LINE 6: WHERE u.group_id = g2.id
^
HINT: There is an entry for table "u", but it cannot be referenced from this part of the query.
| id | name | group_id | columntoupdate |
|---|---|---|---|
| 1 | Paul | 1 | null |
| 2 | Mike | 1 | null |
| 3 | Charlie | 1 | null |
| 3 | Elza | 2 | null |