group by or compute in a view definition

This restriction applies to all columns in views that contain aggregate values—that is, views that have a definition that includes a group by or compute clause. Here is a view defined with a group by clause and the rows seen through it:

create view categories (category, average_price) 
as select type, avg(price) 
from titles 
group by type 
select * from categories 
category         average_price 
-------------    ------------- 
UNDECIDED                 NULL 
business                 13.73 
mod_cook                 11.49 
popular_comp             21.48 
psychology               13.50 
trad_cook                15.96 
 
(6 rows affected) 

You cannot insert rows into the view categories, because the group to which an inserted row would belong cannot be determined. Updates on the average_price column are not allowed, because there is no way to determine how the underlying prices should be changed.