agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Lee Siu Hoi (BACS4 Class A) <cs400514@comp.hkp.hk>
To: postgres@postgres.Berkeley.EDU
Date: Mon, 2 May 94 07:00:30 HKT
Message-ID: <9405012300.AA13088@csun02.COMP.HKP.HK> (raw)

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 "postgres-request@postgres.Berkeley.EDU"

    If this fails, send mail to "post_questions@postgres.Berkeley.EDU" and
    a human will deal with it.  DO NOT post to the "postgres" mailing list.
===============================================================================




reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: postgres@postgres.berkeley.edu
  Cc: cs400514@comp.hkp.hk
  Subject: Re: 
  In-Reply-To: <9405012300.AA13088@csun02.COMP.HKP.HK>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox