Re: [GENERAL] LEFT and RIGHT JOIN

2012-06-29 Thread Misa Simic
e 29, 2012 5:36 PM > To: pgsql > Subject: [GENERAL] LEFT and RIGHT JOIN > > Hi, > > I have met some strange situation... Could someone explain difference > between LEFT and RIGHT JOIN? I thought it is just from whitch side we are > looking in JOIN columns part... but it seems

Re: [GENERAL] LEFT and RIGHT JOIN

2012-06-29 Thread Tom Lane
Misa Simic writes: > Yes you are right... I wanted: t1 left join (t2 inner join t3) > Is there a way to "say" that? Sure, just add the parentheses. t1 left join (t2 inner join t3 on t2-t3-condition) on t1-t2-condition > I mean to me, it is logical and without > brackets... i.e. t1 left

Re: [GENERAL] LEFT and RIGHT JOIN

2012-06-29 Thread Misa Simic
Thanks Tom, Yes you are right... I wanted: t1 left join (t2 inner join t3) Is there a way to "say" that? I mean to me, it is logical and without brackets... i.e. t1 left join t2 inner join t3 left join t4, I would read as: t1 left join (t2 inner join t3) left join t4 (Like INNER has advantage

Re: [GENERAL] LEFT and RIGHT JOIN

2012-06-29 Thread David Johnston
From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-ow...@postgresql.org] On Behalf Of Misa Simic Sent: Friday, June 29, 2012 5:36 PM To: pgsql Subject: [GENERAL] LEFT and RIGHT JOIN Hi, I have met some strange situation... Could someone explain difference between LEFT and RIGHT

Re: [GENERAL] LEFT and RIGHT JOIN

2012-06-29 Thread Tom Lane
Misa Simic writes: > If we run query: > SELECT t1.sometext AS c1, t2.sometext AS c2, t3.sometext AS c3 > FROM > t1 > *LEFT* JOIN t2 ON t1.id = t2.id > INNER JOIN t3 ON t2.id = t3.id > Result is unexpected to me: > but if we run > SELECT t1.sometext AS c1, t2.sometext AS c2, t3.sometext AS c3

[GENERAL] LEFT and RIGHT JOIN

2012-06-29 Thread Misa Simic
Hi, I have met some strange situation... Could someone explain difference between LEFT and RIGHT JOIN? I thought it is just from whitch side we are looking in JOIN columns part... but it seems that is not the case I have three Tables with the same structure... CREATE TABLE t1 ( id integer