Multiple columns w/single aggregate - Mailing list pgsql-general

From Robert M. Craver II
Subject Multiple columns w/single aggregate
Date
Msg-id 3A6B502B.8762960E@home.com
Whole thread Raw
Responses Re: Multiple columns w/single aggregate  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-general
I cannot successfully execute the sql statement:

SELECT percentage, MAX(start_date) FROM sometable
WHERE id = 1

I get the error message:

   ERROR: Attribute sometable.percentage must be GROUPed
   or used in an aggregate function

I know that I have seen examples of selecting multiple columns with a
single colunn aggregate function.  In fact, the new 'PostgreSQL:
Introductions and Concepts' book by Bruce Momjian has two on page 53.
Does anyone know why this doesn't work?

Thanks in advance.


pgsql-general by date:

Previous
From: Alexander Jerusalem
Date:
Subject: postgresql memory management
Next
From: "Rob Arnold"
Date:
Subject: Re: VACUUM ANALYZE FAILS on 7.0.3