首页 > 数据库技术 > 详细

解决"Subquery returns more than 1 row"sql查询错误

时间:2014-11-09 09:42:29      阅读:1138      评论:0      收藏:0      [点我收藏+]

http://blog.csdn.net/c517984604/article/details/7052186 [Err] 1242 - Subquery returns more than 1 row   --表示子查询返回了多行数据

例如:

select * from table1 where table1.colums=(select columns from table2)

解决方法

1,select * from table1 where column=any(select columns  from table2)

2,select * from table1 where column in(select columns  from table2);

3,select * from table1 a where exists 
(select columns from tableb2 b
where b.column=a.column
);
 

解决"Subquery returns more than 1 row"sql查询错误

原文:http://www.cnblogs.com/svennee/p/4084434.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!