mysql 1242 subquery returns more than 1 row

【网上购物论坛】-IT泡吧![Www.itpb.Cn]网上购物社区! - Powered by Discuz!
http://www.itpob.cn/index.php

 

来自子查询的行的数目不正确: ERROR 1242 (ER_SUBSELECT_NO_1_ROW) SQLSTATE = 21000 Message = "Subquery returns more than 1 row" 如果在语句中,子查询返回的行多于一个,则发生此错误。请考虑以下例子: SELECT * FROM t1 WHERE column1 = (SELECT column1 FROM t2); 如果SELECT column1 FROM t2只返回一行,则将执行以前的查询。如果子查询返回的行多于一个,则将出现错误1242。在这种情况下,该查询将被改写为: SELECT * FROM t1 WHERE column1 = ANY (SELECT column1 FROM t2); SELECT XXX FROM 表1 WHERE XX = X AND XXX = ANY (SELECT XXX FROM 表2);

来自:IT泡吧

你可能感兴趣的:(return)