Re: RFE: Use JOIN instead of WHERE in Graphical Query Builder
От | Daniel Serodio (lists) |
---|---|
Тема | Re: RFE: Use JOIN instead of WHERE in Graphical Query Builder |
Дата | |
Msg-id | 5005EFE9.2090608@mandic.com.br обсуждение исходный текст |
Ответ на | Re: RFE: Use JOIN instead of WHERE in Graphical Query Builder ("Nelson A. de Oliveira" <naoliv@gmail.com>) |
Ответы |
Re: RFE: Use JOIN instead of WHERE in Graphical
Query Builder
|
Список | pgadmin-support |
Nelson A. de Oliveira wrote: <blockquote cite="mid:CAARFvTVj8tmZn+SiYCqYodEwey1wpfKfY0RvEHsU1PfgPeCupA@mail.gmail.com" type="cite"><prewrap="">Hi! On Tue, Jul 17, 2012 at 7:36 PM, Daniel Serodio (lists) <a class="moz-txt-link-rfc2396E" href="mailto:daniel.lists@mandic.com.br"><daniel.lists@mandic.com.br></a> wrote: </pre><blockquote type="cite"><pre wrap="">I'm using pgAdmin 1.14.3, and its Graphical Query Builder generates WHERE clauses for joins. It would be nice if it generated JOIN clauses instead. </pre></blockquote><pre wrap=""> Is there any kind of difference between WHERE or JOINs in PostgreSQL? Aren't they all a cartesian product internally? </pre></blockquote> They may be implemented the same way in PostgresSQL, but <span>they're two different concepts. Becauseof this, I find it a lot easier to </span>understand a complex query when the joins are in a JOIN clause.<br /><br/> In more practical terms, it's easier to change "a JOIN b ON a.pk = b.fk" to "a LEFT JOIN b ON a.pk = b.fk" (justhave to type the LEFT keyword, regardless of which tables/columns are used) then change "WHERE a.pk = b.fk" to "WHEREa.pk = b.fk OR b.fk IS NULL" (have to add "<span>OR b.fk IS NULL", which changes according to which tables/columnsare used).<br /><br /> Regards,<br /> Daniel Serodio<br /><br /></span>
В списке pgadmin-support по дате отправления: