Re: Another Newbie SQL question....

From: Joe Nardone <joe_at_access1.digex.net>
Date: 1995/11/06
Message-ID: <47jqir$12b_at_news4.digex.net>#1/1


Al Corvino (corvino_at_rohan.sdsu.edu) wrote:
: DESCRIBE FOO;
:
: ID# CHAR(4)
: BAR NUMBER
: DEPT CHAR(15)
:
: Ok, how can I select an avg(BAR) grouped by DEPT for each ID#? What I want to do is
: something like:
:
: SELECT id# as ID_NUMBER, avg(BAR) FROM foo
: group by DEPT;
:

Wouldn't this work?

Select id# id_number,dept, avg(bar) from foo group by dept, id#;

Joe

:
 

-- 
                                   
=------------------------------------------------------------------------=
Joe Nardone               |    
joe_at_access.digex.net      |
Received on Mon Nov 06 1995 - 00:00:00 CET

Original text of this message