Re: Displaying chat by punished users only to themselves (db fiddle attached)
От | David G. Johnston |
---|---|
Тема | Re: Displaying chat by punished users only to themselves (db fiddle attached) |
Дата | |
Msg-id | CAKFQuwbziP5EdzBjmrHpH3u80He=ED=5Hg9+7MPmA0StpX8DGw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Displaying chat by punished users only to themselves (db fiddle attached) (Alexander Farber <alexander.farber@gmail.com>) |
Ответы |
Re: Displaying chat by punished users only to themselves (db fiddle attached)
|
Список | pgsql-general |
On Wed, May 4, 2022 at 9:12 AM Alexander Farber <alexander.farber@gmail.com> wrote:
I have tried CROSS JOIN and CASE WHEN (why be greedy, right?):WITH myself AS (SELECT uidFROM words_socialWHERE social = in_socialAND sid = in_sidLIMIT 1),opponent AS (SELECT CASE WHEN player1 = myself.uid THEN player2 ELSE player1 ENDFROM words_gamesWHERE gid = in_gid)SELECTCASE WHEN c.uid = myself.uid THEN 1 ELSE 0 END,c.msgFROM myself CROSS JOIN opponentWHERE (c.uid = myself.uid OR NOT opponent.muted)ORDER BY c.CREATED ASC;but the error is:ERROR: missing FROM-clause entry for table "myself"LINE 60: SELECT CASE WHEN player1 = myself.uid THEN play...
What exactly are you trying to do in the "opponent" cte - and why do you think the myself cte is visible to it?
David J.
В списке pgsql-general по дате отправления: