Re: [HACKERS] [6.5.2] join problems ... - Mailing list pgsql-hackers

From The Hermit Hacker
Subject Re: [HACKERS] [6.5.2] join problems ...
Date
Msg-id Pine.BSF.4.10.9909191046050.27097-100000@thelab.hub.org
Whole thread Raw
In response to Re: [HACKERS] [6.5.2] join problems ...  (Mike Mascari <mascarim@yahoo.com>)
List pgsql-hackers
On Sun, 19 Sep 1999, Mike Mascari wrote:

> SELECT c.id, c.name, c.url 
> FROM aecEntMain a, aecWebEntry b, aecCategory c
> WHERE a.status LIKE 'active:ALL%'
> AND a.representation LIKE '%:ALL%'
> AND b.status LIKE 'active:ALL%'
> AND b.indid='$indid' 
> AND b.divid='$divid' 
> AND (a.id,a.mid = b.id,b.mid) 
> AND (b.catid,b.indid,b.divid = c.id,c.ppid,c.pid);

Only point I'd like to make (thanks for all the details, gives me alot to
work with...) is that the above is not valid in PostgreSQL, it seems...I
changed the last two AND lines to be:

AND (a.id=b.id AND a.mid=b.mid) 
AND (b.catid=c.id AND b.indid=c.ppid AND b.divid=c.pid)

and it eliminiated the error, but gave me zero results...

Please note, in my own defence...I'm working on cleaning up a mess created
by someone else using MySQL...what has to be done is a cleanup of the
tables themselves, but trying to fix some of the SQL first appears to be
the "route of least resistance" :(  Or, at least, it appeared to
be...starting to change my mind on that one heavily :)


Marc G. Fournier                   ICQ#7615664               IRC Nick: Scrappy
Systems Administrator @ hub.org 
primary: scrappy@hub.org           secondary: scrappy@{freebsd|postgresql}.org 



pgsql-hackers by date:

Previous
From: "Jason Doller"
Date:
Subject: PERL
Next
From: The Hermit Hacker
Date:
Subject: All things equal, we are still alot slower then MySQL?