On 20/09/12 03:08, Merlin Moncure wrote:
On Tue, Sep 18, 2012 at 7:47 PM, David Johnston wrote:
>On Sep 18, 2012, at 20:21, Jean-Christophe Boggio
wrote:
>
>>I'm looking for an article that explains the difference between these
constructs IN POSTGRESQL (the rules seem to differ from one DB
Comments embedded between
>
> David,
>
> Thanks for the verbose explanations, really useful.
>
> However, in my case :
> - type is never NULL
Assuming you mean the "og.type" (i.e., the right-side of the join) even
though the column
David,
Thanks for the verbose explanations, really useful.
However, in my case :
- type is never NULL
- there are no lines from uidinoldgroups that match the "FROM ldap" join.
But I think I got it :
drop table if exists tmpA;
drop table if exists tmpB;
create temp table tmpA (name varchar);
in
> I have this query working :
> select profil,count(og.name)
> from ldap l
> left join uidinoldgroups ug on l.uid=ug.uid left join oldgroups og on
> og.id=ug.idgroupe and og.rne='0410030k' and og.type='g'
> where l.profilgeneral='P'
> and l.rne='0410030k'
> group by l.profil
>
> But if I put :
>
Merlin Moncure wrote:
> By having the filtering in the where clause, the intended purpose
> of the left join, to return every row of foo, is being defeated
> and the join will behave like an inner join. The right way to do
> it is:
>
> SELECT * FROM foo LEFT JOIN BAR ON foo.id = bar.id AND bar
Le 19/09/2012 17:08, Merlin Moncure a écrit :
SELECT * FROM foo LEFT JOIN BAR ON foo.id = bar.id AND bar.col = 'something';
The difference here is that the filtering is now happening at join
time where the left join semantics are playing: always return foo and
return bar rows if and only if the
Le 19/09/2012 02:47, David Johnston a écrit :
> There is no difference in your example. Conceptually though I
> suggest using only table-table conditions in an ON clause and placing
> any table-value conditions into the where.
This is how I use it usually.
> The main time you get differences is
On Tue, Sep 18, 2012 at 7:47 PM, David Johnston wrote:
> On Sep 18, 2012, at 20:21, Jean-Christophe Boggio
> wrote:
>
>> I'm looking for an article that explains the difference between these
>> constructs IN POSTGRESQL (the rules seem to differ from one DB to another) :
>>
>> SELECT A.*
>> FROM
On Sep 18, 2012, at 20:21, Jean-Christophe Boggio
wrote:
> I'm looking for an article that explains the difference between these
> constructs IN POSTGRESQL (the rules seem to differ from one DB to another) :
>
> SELECT A.*
> FROM A
> JOIN B ON a.id=b.id AND A.somefield='somevalue'
>
> and
>
I'm looking for an article that explains the difference between these
constructs IN POSTGRESQL (the rules seem to differ from one DB to another) :
SELECT A.*
FROM A
JOIN B ON a.id=b.id AND A.somefield='somevalue'
and
SELECT A.*
FROM A
JOIN B ON a.id=b.id
WHERE A.somefield='somevalue'
I have
10 matches
Mail list logo