Another Newbie SQL question....
From: Al Corvino <corvino_at_rohan.sdsu.edu>
Date: 1995/11/05
Message-ID: <47h6kt$a1a_at_gondor.sdsu.edu>#1/1
Date: 1995/11/05
Message-ID: <47h6kt$a1a_at_gondor.sdsu.edu>#1/1
Ok I think this one is a little (just a little though) more involved than my last 'Newbie SQL question' although it again covers those dreaded group by queries. (P.S. Thanks again to everyone who helped.)
This time what I need to do is give a an avg(VALUE) for a bunch of individuals. Example:
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;
But this does not work. Any guesses as to what does?
Thanks again,
Al
Received on Sun Nov 05 1995 - 00:00:00 CET