agora inbox for postgres@postgres.berkeley.edu  
help / color / mirror / Atom feed
From: Niranjan Perera <perera@pollux.cs.uga.edu>
To: postgres@postgres.Berkeley.EDU
Subject: postquel query question.
Date: Thu, 26 May 94 08:52:38 EDT
Message-ID: <9405261252.AA27280@pollux.cs.uga.edu> (raw)

I have the following class:

	emp ( name, ssn, sal,  dno )

I would like to construct a postquel query that would do the following:

find the average salary of employees grouped by `dno'. i.e I would like
to find the average salary in department 1, 2, 3 etc..

The SQL version of this query is:

select  avg(sal)
from emp
group by dno.

Any suggestions ?

Thanks,

-- Niranjan

p.s: postgres version 4.2.

==============================================================================
   To add/remove yourself to/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: perera@pollux.cs.uga.edu
  Subject: Re: postquel query question.
  In-Reply-To: <9405261252.AA27280@pollux.cs.uga.edu>

* 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