Search Postgresql Archives

Re: change the order of FROM selection to make query work

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

 



Am 26.9.2006 schrieb "Tom Lane" <tgl@xxxxxxxxxxxxx>:
>> FROM ticket as t, permission as perm, enum as p
>> LEFT OUTER JOIN ticket_custom c ON (t.id = c.ticket AND c.name =
>> 'fachabteilung')
>
>The above is, plain and simple, wrong.  According to the SQL spec,
>JOIN binds more tightly than comma in a FROM-list, so what you had was
>
>FROM ..., (enum as p
>  LEFT OUTER JOIN ticket_custom c ON (t.id = c.ticket AND c.name =
>  'fachabteilung'))
>
>which of course fails because only p and c are visible in the JOIN's
>ON condition.  You fixed it by moving "t" to become part of the JOIN
>structure.

ok, lesson learned.
thank you!

cheers,
thomas


[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