i have this table in Database
Student Table
–studentId
–StudentName
–Mathgrade
–physicsgrade
and i want to do select query to select the studentID and summation of all students’ grade
i try to do this using this Query
$selectedStudents = Yii::app()->db->createCommand()
->select('studentID' ,
('Mathgrade' + 'physicsgrade').' As TotalGrads')
->from('student')
->queryAll() ;
but when thus Query was executed i get this error
CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘0’ in ‘field list’. The SQL statement executed was: SELECT 0
FROM student
i dont know what is error please can any one help me thank in advanced