Re: Aggregates not allowed in WHERE clause? - Mailing list pgsql-sql

From Christopher Kings-Lynne
Subject Re: Aggregates not allowed in WHERE clause?
Date
Msg-id GNELIHDDFBOCMGBFGEFOEENJCCAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Aggregates not allowed in WHERE clause?  (Joachim Trinkwitz <jtr@uni-bonn.de>)
List 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



pgsql-sql by date:

Previous
From: Joachim Trinkwitz
Date:
Subject: Aggregates not allowed in WHERE clause?
Next
From: Achilleus Mantzios
Date:
Subject: Re: Aggregates not allowed in WHERE clause?