Re: Aggregates not allowed in WHERE clause?

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Joachim Trinkwitz" <jtr(at)uni-bonn(dot)de>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Aggregates not allowed in WHERE clause?
Date: 2002-06-19 08:13:28
Message-ID: GNELIHDDFBOCMGBFGEFOEENJCCAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Next I tried this one:
>
> SELECT kvvnr, max(lf_sem.semester) AS akt_semester
> FROM lv, lf_sem
> WHERE lv.semester = akt_semester;
>
> Now I got: 'Attribute 'akt_semester' not found'
>
> Is there another way to get what I want?

What about:

SELECT kvvnr FROM lv WHERE semester = (SELECT MAX(semester) FROM lf_sem);

Chris

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Achilleus Mantzios 2002-06-19 08:18:13 Re: Aggregates not allowed in WHERE clause?
Previous Message Joachim Trinkwitz 2002-06-19 08:04:24 Aggregates not allowed in WHERE clause?