You're getting better; you've enclosed the offending message id. Great.
Now, if you read that message further you will see
DSPMSGD RANGE(SQL0122) MSGF(QSQLMSG)
1. Display message text
-- The statement contains column name &1 and an aggregate function in
SELECT clause and no GROUP BY clause is specified.
But it's the first one. You cannot put a column in a select when you have
an aggregate function like SUM, without doing a control break on that
selected column. In SQL a control break is done with GROUP BY.
Still gotta recommend reading a getting started with sql type book. Like
SQL/400 Developer's Guide (Vol 2)Sep 2000
by Mike Cravitz and Paul Conte
Old but a great start.
Selling for as low as $7.32