Re: Syntax bug? Group by? - Mailing list pgsql-hackers

From D'Arcy J.M. Cain
Subject Re: Syntax bug? Group by?
Date
Msg-id 20061017124721.96646085.darcy@druid.net
Whole thread Raw
In response to Re: Syntax bug? Group by?  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
On Tue, 17 Oct 2006 12:08:07 -0400
Stephen Frost <sfrost@snowman.net> wrote:
> * Mark Woodward (pgsql@mohawksoft.com) wrote:
> > If I am asking for a specific column value, should I, technically
> > speaking, need to group by that column?
> 
> Technically speaking, if you're asking for a specific tuple, should you
> be allowed to request an aggregation?

One column value doesn't necessarily mean one tuple unless it has a
unique index on that column.

SELECT COUNT(*) FROM table WHERE field = 'value';

That's perfectly reasonable.  You don't need the GROUP BY clause.

However, this doesn't sound like a hackers question.  Next time, please
ask on another list such as pgsql-sql or even pgsql-novice.  You can
review the mailing lists and their purpose at
http://www.postgresql.org/community/lists/

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.


pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: Additional stats for Relations
Next
From: Jeff Davis
Date:
Subject: Re: constraints in query plans