Re: [SQL] Ordering with GROUPs

2002-08-19 Thread Julian Scarfe
From: "Tom Lane" <[EMAIL PROTECTED]> > ISTM the problem here is the lack of any ordering operator for POINT, > which defeats GROUP BY, *plus* the lack of any aggregate you might use > for an aggregate-based solution. This is not really a language failing > but a problem with an impoverished data

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] 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