1
CREATE TABLE Average_Professor

SELECT ie.Instructor
      ,SUM(ie.instreffective_avg + h.howmuchlearned_avg + ir.instrrespect_avg +
 iv.instroverall_avg + av.availability_avg)/5
FROM   instreffective_average ie
JOIN   howmuchlearned_average h  USING (Instructor)
JOIN   instrrespect_average   ir USING (Instructor)
JOIN   instructoroverall_average   iv USING (Instructor)
JOIN   availability_average   av USING (Instructor)
GROUP  BY Instructor

エラー コード 1166 が表示されます。「CREATE TABLE Professor_average」を省略すると、スクリプトは実行されますが、テーブルは作成されません。

4

1 に答える 1

1

計算列に名前を付けてみてください。

CREATE TABLE Average_Professor
SELECT ie.Instructor
      ,SUM(ie.instreffective_avg + h.howmuchlearned_avg + ir.instrrespect_avg +
 iv.instroverall_avg + av.availability_avg)/5 as calculation_value
FROM   instreffective_average ie
JOIN   howmuchlearned_average h  USING (Instructor)
JOIN   instrrespect_average   ir USING (Instructor)
JOIN   instructoroverall_average   iv USING (Instructor)
JOIN   availability_average   av USING (Instructor)
GROUP  BY Instructor
于 2013-02-10T20:51:24.943 に答える