mysql在一列中计算一些列的值

Don*_*tis 1 mysql select count

我有MySQL表:

table
| ID | col1 | col2 | col 3|
  1      1      0      1
  2      0      1      1
  3      1      1      1
Run Code Online (Sandbox Code Playgroud)

如何将一列中的所有col1,col2,col3计数到这样的每一行?

table
| ID | colnew |
  1      2      
  2      2    
  3      3
Run Code Online (Sandbox Code Playgroud)

谢谢.

egg*_*yal 5

SELECT ID, col1 + col2 + col3 AS colnew FROM my_table
Run Code Online (Sandbox Code Playgroud)