Jim,
Any Aggregate Function (like SUM), needs to be in a group by syntax, if
there are other columns selected that are not in aggregate functions.

You have to group by every column you reference that is not in an aggregate
expression, and those group by columns define the groups for which you are
creating a sum. For example:

As group by:
create temporary view SPEEDYWORK (procnum, procdesc, tottime) +
as select procnum, procdesc, sum(timeout-timein) +
from workinfo +
where  procnum = 'spdy-82' +
and procdesc contains '222' +
group by procnum, procdesc


>
> I am trying to create a temporary view and get an error stating "illegal
select function".  Can anyone look at the code below and tell me what I am
doing wrong?
>
>
>
> create temporary view SPEEDYWORK (procnum, procdesc, tottime) as select
procnum, procdesc, sum(timeout-timein) from workinfo where  procnum =
'spdy-82' and procdesc contains '222'
>
>
>
> Jim
>
>

Reply via email to