| From: | "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net> |
|---|---|
| To: | Stephen Frost <sfrost(at)snowman(dot)net> |
| Cc: | pgsql(at)mohawksoft(dot)com, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: Syntax bug? Group by? |
| Date: | 2006-10-17 16:47:21 |
| Message-ID: | 20061017124721.96646085.darcy@druid.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, 17 Oct 2006 12:08:07 -0400
Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> * Mark Woodward (pgsql(at)mohawksoft(dot)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(at)druid(dot)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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Jeff Davis | 2006-10-17 17:08:28 | Re: constraints in query plans |
| Previous Message | Stephen Frost | 2006-10-17 16:08:07 | Re: Syntax bug? Group by? |