oracle - Creat view with a avg column -


i need create view view uos_vu_student_average, 1 of column requries average grade, sql:

create view uos_vu_student_average select student.first_name, student.last_name, student_module.grade student, student_module student_id<120000001  

how avg grade in sql?

you have use "group by" mathematical function

avg ( [ | distinct ] expression ) 

for example ..

select id, avg(salary) tablename group filedname 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -