mysql - How to create a new table that takes the average of columns in other tables based on name -



mysql - How to create a new table that takes the average of columns in other tables based on name -

create table average_professor select ie.instructor ,sum(ie.instreffective_avg + h.howmuchlearned_avg + ir.instrrespect_avg + iv.instroverall_avg + av.availability_avg)/5 instreffective_average ie bring together howmuchlearned_average h using (instructor) bring together instrrespect_average ir using (instructor) bring together instructoroverall_average iv using (instructor) bring together availability_average av using (instructor) grouping instructor

it's giving me error code 1166. if omit "create table professor_average" script runs, yet don't have table created.

try naming calculation column:

create table average_professor select ie.instructor ,sum(ie.instreffective_avg + h.howmuchlearned_avg + ir.instrrespect_avg + iv.instroverall_avg + av.availability_avg)/5 calculation_value instreffective_average ie bring together howmuchlearned_average h using (instructor) bring together instrrespect_average ir using (instructor) bring together instructoroverall_average iv using (instructor) bring together availability_average av using (instructor) grouping instructor

mysql

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -