我有这样的简单表:
+----------+---------------+-------------+
| ID (int) | KEY (varchar) | VALUE (int) |
+----------+---------------+-------------+
| 1 | asdf | 100 |
| 2 | fdsa | 321 |
| 3 | ecda | 211 |
+----------+---------------+-------------+
我想更新行,KEY = 'something'
但如果没有KEY = 'something'
我想要INSERT
新行的行:
+----------+---------------+-------------+
| ID (int) | KEY (varchar) | VALUE (int) |
+----------+---------------+-------------+
| 1 | asdf | 100 |
| 2 | fdsa | 321 |
| 3 | ecda | 211 |
| 4 | something | 200 |
+----------+---------------+-------------+
是否可以仅在一个查询中进行?