Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有那个 MySQL 表:
table | ID | col1 | col2 | col 3| 1 1 0 1 2 0 1 1 3 1 1 1
如何像这样将每一列中的所有 col1、col2、col3 计数到每一行?
table | ID | colnew | 1 2 2 2 3 3
谢谢。
SELECT ID, col1 + col2 + col3 AS colnew FROM my_table