Re: [SQL] Need Help for select

2002-08-18 Thread Andre Schubert
On Thu, 15 Aug 2002 11:17:15 +0900 "Masaru Sugawara" <[EMAIL PROTECTED]> wrote: > On Wed, 14 Aug 2002 16:04:21 +0200 > Andre Schubert <[EMAIL PROTECTED]> wrote: > > > > I want to compare if a tuple in c exist in b for each c.d_id and b.a_id. > > In c exists 3 tuples: (1,2), (3,4), (5) > > and w

Re: [SQL] Ordering with GROUPs

2002-08-18 Thread Tom Lane
"Julian Scarfe" <[EMAIL PROTECTED]> writes: > SELECT location.ident, node, count(*) from location, message > WHERE location.ident = message.ident > GROUP BY location.ident; > ERROR: Attribute location.node must be GROUPed or used in an aggregate > function > it obviously fails. If node were an

Re: [SQL] Unexplained SQL behavior

2002-08-18 Thread Tom Lane
"JOE" <[EMAIL PROTECTED]> writes: > I am debugging a performance problem with a view. I have narrowed down the= > problem to when I adeed columns to my view. Okay, I see the problem: it is in fact a bug, and one that's been around for awhile. (Curious no one's noticed before.) When you wrote

Re: [SQL] Ordering with GROUPs

2002-08-18 Thread Bruno Wolff III
On Sun, Aug 18, 2002 at 12:49:18 +0100, Julian Scarfe <[EMAIL PROTECTED]> wrote: > I'm struggling to find an appropriate efficient query for an aggregate-type > problem and I'd appreciate suggestions. > > I have messages associated with a set of locations (zero or more messages > per location).

[SQL] Ordering with GROUPs

2002-08-18 Thread Julian Scarfe
I'm struggling to find an appropriate efficient query for an aggregate-type problem and I'd appreciate suggestions. I have messages associated with a set of locations (zero or more messages per location). A cut down test is as follows: CREATE TABLE location (ident char(4), node point); INSERT I