Search Postgresql Archives

Re: How to optimize SELECT query with multiple CASE statements?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 31 October 2016 at 15:21, Geoff Winkless <pgsqladmin@xxxxxxxx> wrote:
> LEFT JOIN words_social s1 ON s1.uid = in_uid
> LEFT JOIN words_social s2 ON CASE WHEN g.player1 = in_uid THEN
> g.player2 ELSE g.player1

Ugh.

Of course I meant

LEFT JOIN words_social s1 ON s1.uid = in_uid
LEFT JOIN words_social s2 ON s2.uid = CASE WHEN g.player1 = in_uid
THEN g.player2 ELSE g.player1 END

But I expect you know that...

Geoff


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux