Re: [SQL] Outer joins

2006-04-29 Thread Emils
(damn gmail, sorry about priv mail earlier) Stephan Szabo <[EMAIL PROTECTED]>: I think putting a test in an ON clause associated with the join (using something like ... left join object_values ov1 ON(ov.obj_id = ov1.obj_id and ov1.att_id=8) rather than where will consider both as part of the joi

Re: [SQL] Outer joins?

2006-04-28 Thread Tom Lane
Emils <[EMAIL PROTECTED]> writes: > The table structure is: > object_values > == > obj_id > att_id > value > namely, each object can have arbitrary number of attributes each of > them with a value. > What I want, is a simple table of objects with some of their specific > attributes, the

Re: [SQL] Outer joins?

2006-04-28 Thread Stephan Szabo
On Fri, 28 Apr 2006, Emils wrote: > I am trying to do simple self-joins. > > The table structure is: > > object_values > == > obj_id > att_id > value > > namely, each object can have arbitrary number of attributes each of > them with a value. > > What I want, is a simple table of objects w

[SQL] Outer joins?

2006-04-28 Thread Emils
Hello! I am a longtime postgres user (started around 10 years ago), however, as for some years I've been using it mostly as administrator. Now that I have started a project and doing some SQL, I've come up something I don't believe is right. Maybe I am too rusty on my SQL - if so, please forgive

Re: [HACKERS] [SQL] outer joins strangeness

2001-09-24 Thread Tom Lane
Alex Pilosov <[EMAIL PROTECTED]> writes: > I'm going to CC this to -hackers, maybe someone will shed a light on the > internals of this. It's not unintentional. See http://www.ca.postgresql.org/users-lounge/docs/7.1/postgres/explicit-joins.html regards, tom lane --

Re: [SQL] outer joins strangeness

2001-09-24 Thread Stephan Szabo
On Mon, 24 Sep 2001, Alex Pilosov wrote: > On Sun, 23 Sep 2001, Stephan Szabo wrote: > > > On Sun, 23 Sep 2001, Alex Pilosov wrote: > > > > Postgres treats join syntax as an explicit definition of what order to > > joins in. So, I'd guess it sees the first as: do the LOJ and then join > > that

Re: [SQL] outer joins strangeness

2001-09-23 Thread Alex Pilosov
On Sun, 23 Sep 2001, Stephan Szabo wrote: > On Sun, 23 Sep 2001, Alex Pilosov wrote: > > > It may be just me, or I am grossly misunderstanding syntax of outer joins, > > but I see that plans for my queries are different depending on how I place > > join conditions and sometimes even on order of

Re: [SQL] outer joins strangeness

2001-09-23 Thread Stephan Szabo
On Sun, 23 Sep 2001, Alex Pilosov wrote: > It may be just me, or I am grossly misunderstanding syntax of outer joins, > but I see that plans for my queries are different depending on how I place > join conditions and sometimes even on order of the tables. > > Example: > 1: > explain select * fro

[SQL] outer joins strangeness

2001-09-23 Thread Alex Pilosov
It may be just me, or I am grossly misunderstanding syntax of outer joins, but I see that plans for my queries are different depending on how I place join conditions and sometimes even on order of the tables. Basically, if I mix ANSI-syntax outer joins (a left outer join b on a.id=b.id) and "wher

Re: [SQL] outer joins

2001-04-04 Thread [EMAIL PROTECTED]
Algirdas, This should do the trick: SELECT a.id,b.name FROM a,b WHERE a.id=b.id UNION SELECT id,null FROM a WHERE id NOT IN (SELECT id FROM b); Troy > > Hi all, > > I'm new to postgre, I've changed my work and consequently now i'm moving > from MS plaform. > In MS SQL there are such constr

RE: [SQL] outer joins

2001-04-04 Thread Picard, Cyril
I've read that the version 7.1 provides outer join feature. Since I did not try it yet, I've no more information about it. > -Message d'origine- > De: Algirdas Sakmanas [SMTP:[EMAIL PROTECTED]] > Date: mercredi 4 avril 2001 13:03 > À:[EMAIL PROTECTED]

Re: [SQL] outer joins

2001-04-04 Thread Poet/Joshua Drake
Hello, I believe these are supported in 7.1 On Wed, 4 Apr 2001, [iso-8859-4] Algirdas ©akmanas wrote: >Hi all, > >I'm new to postgre, I've changed my work and consequently now i'm moving >from MS plaform. >In MS SQL there are such constructs left or right outer join, in postgres >there are no

[SQL] outer joins

2001-04-04 Thread Algirdas Šakmanas
Hi all, I'm new to postgre, I've changed my work and consequently now i'm moving from MS plaform. In MS SQL there are such constructs left or right outer join, in postgres there are no such thing Can You offer me strategy to make query that selects from table (a) and joins to it another (b) on e

Re: [SQL] Outer Joins

2000-11-02 Thread Josh Berkus
Marc, Tom, > Good point. Frankly, if you have a relevant large population of data > (>10,000 rows) to test, I'd love to see comparative execution tests > between the two query structures. > > Fortunately, this will all soon become moot; Tom says that outer joins > have been stable in the 7.1 bu

Re: [SQL] Outer Joins

2000-11-02 Thread Josh Berkus
Marc, > >This would work, but it would be *much* slower than a UNION query. "Not > >In" queries are perhaps the slowest you can run; see the earlier thread > >"Query Problem" for a discussion. UNION queries are, in fact, very fast > >... just awkward to code and manipulate. > > Why should this

Antw: [SQL] Outer Joins

2000-11-01 Thread Gerhard Dieringer
>>> "Marc Rohloff" <[EMAIL PROTECTED]> 01.11.2000 09.02 Uhr >>> > > select a.col1, b.col2 from a,b > where a.col1 = b.col2 > or b.col2 is null > This query has nothing to do with an outer join. See the following example: table a c1 --- x y and table b c2 --- x Then an outer join give

Re: [SQL] Outer Joins

2000-11-01 Thread Marc Rohloff
>> select a.col1, b.col2 from a,b >> where a.col1 = b.col2 >>or a.col1 not in (select b.col2 from b) >This would work, but it would be *much* slower than a UNION query. "Not >In" queries are perhaps the slowest you can run; see the earlier thread >"Query Problem" for a discussion. UNION qu

Re: [SQL] Outer Joins

2000-11-01 Thread Josh Berkus
Marc, > select a.col1, b.col2 from a,b > where a.col1 = b.col2 >or b.col2 is null The above would select each record in a that matched a record in b, plus each record in b for every possible a where b.col2 was null - not where there was no match. > select a.col1, b.col2 from a,b > where a.

Re: [SQL] Outer Joins

2000-11-01 Thread Grant Finnemore
Marc, I did not look at your queries, but outer joins are supported in the latest development version of PostgreSQL, and will be supported in the upcoming 7.1 release of the software - beta due soon. Regards, Grant Marc Rohloff wrote: > I've been looking at the open-source databases for a pr

[SQL] Outer Joins

2000-10-31 Thread Marc Rohloff
I've been looking at the open-source databases for a project I am working on and while reading about Postgres I saw that they do not support outer joins yet. I was intrigued by their solution of using a union query. Something Like: select a.col1, b.col2 from a,b where a.col1 = b.col2 union sele