mysql - add column value from a 1 row of a table and display the other column -


i want add multiple column , display other column. here database table:

id | firstname | lastname | score1 | score2 | score3  1  | mark      | lupez    | 5      | 7      | 4      2  | james     | cruz     | 6      | 3      | 5      

i want add score1, score2 , score3 in every row , display this:

id | lastname | firsname | total_score | 1  | mark     | lupez    | 16          | 2  | james    | cruz     | 14          | 

i try google , find answer no luck, mind not working though.

just add score columns:

select id,        firstname,        lastname,        score1 + score2 + score3 total_score yourtable 

Comments

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -