mysql连表查询报错:Subqueryreturnsmorethan1row
意思是查询的数据不能多余⼀⾏,多余⼀⾏就会报错。
解决⽅法:宝宝食谱
化妆品关税忆往昔>跆拳道双飞踢1、需要在语句后⾯加上limit 1
⽐如:
SELECT `kid_id` FROM `tl_player` WHERE `id`=(SELECT `player_id` FROM `tl_player_travel_ur_city` WHERE `city_id`=1 AND `status`=2) limt 1
2、在⼦查询前加any关键字
⽐如:
剧本英语SELECT * FROM `tl_order` WHERE `member_id`=any(SELECT `member_id` FROM `tl_kid` WHERE `id`=any(SELECT `kid_id` FROM `tl_player` WHERE `id`=any(SELECT `player_id` FROM `tl_player_travel_ur_city` WHERE `city_id`=1 AND `status`=2))) AND (`goods_id`=123 or `goods_id`=13) AND `status`=0
关于笑的四字词语>秋季风景
第⼀种⽅法适合只需要查询⼀条数据的情况
5朵玫瑰
第⼆种⽅式适合查询多条符合条件的情况