I表1包含:
|col1|
| 1 |
| 2 |
| 1 |
| 3 |
| 1 |
| 2 |
| 4 |
| 2 |
| 3 |
| 1 |
Run Code Online (Sandbox Code Playgroud)
我有另一个表有一个列名val,我的代码是
INSERT INTO table2(value) VALUES ((select distinct col1 from table1))
Run Code Online (Sandbox Code Playgroud)
我得到了 #1242 - 子查询返回超过 1 行。
如何将多行插入到我的 table2 中?