Subject: Re: ?

From: [email-masked] (Lee Siu Hoi (BACS4 Class A))
Date: Mon, 2 May 94 07:00:30 HKT

Hi all,

I have problem in using aggregate functions:

create test (i = int4, .... ) \g
append test (i = 1, ... ) \g
append test (i = 2, ... ) \g
.
.

When I want to retrieve the instance that have the smallest i value:

retrieve (t.all) from t in test where t.i = int4min {test.i} \g

The parser reports error near the "{" symbol.

It is legal to use aggregate function in the where statement?

If no, any other approach can do the similar thing?
I really need to make such queries.

Thanks in advance.
Any suggestion or hints will be appreciated.

Hoi

===============================================================================
    To add/remove yourself from the POSTGRES mailing list: send mail with 
    the subject line ADD or DEL to "[email-masked]"

    If this fails, send mail to "[email-masked]" and
    a human will deal with it.  DO NOT post to the "postgres" mailing list.
===============================================================================

---

From: [email-masked] (Paul M. Aoki)
Date: Tue, 03 May 94 12:31:47 -0700

> It is legal to use aggregate function in the where statement?

this is documented in the reference manual as being broken.

> Any suggestion or hints will be appreciated.

i know an email address where you can send hate mail, but that's
about it at this point..
--
  Paul M. Aoki  |  CS Div., Dept. of EECS, UCB  |  [email-masked]
                |  Berkeley, CA 94720           |  ...!uunet!ucbvax!aoki