小编Ram*_*man的帖子

插入w /多个选择给出ERROR 1242:子查询返回多于1行

我有表foo1的列UserID,TimeStamp; foo2,列为userID,Level&table为foo3,列为userID,Timestamp.

我想从表foo2中存在UserID的foo3中插入foo1的所有行.

我收到错误1242:子查询返回超过1行以下

INSERT into foo1 (UserID,TimeStamp)
SELECT  
(SELECT UserID from foo2 as UserID),

(SELECT foo3.TimeStamp
from foo3
inner join foo2
ON foo3.UserID=foo2.UserID) as TimeStamp
Run Code Online (Sandbox Code Playgroud)

insert-into mysql-error-1242

2
推荐指数
1
解决办法
849
查看次数

标签 统计

insert-into ×1

mysql-error-1242 ×1