[Err] 1242 - Subquery returns more than 1 row

X战猫 2013-04-25 09:35:49
select username,nicname from appaccount where
id in (
(select otherid from friends where localid=(
select id from appaccount where username=#user# )
)
,
(select localid from friends where otherid=(
select id from appaccount where username=#user# )
)
)
为什么不能返回多条呢 求大大解惑
...全文
272 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
X战猫 2013-04-25
  • 打赏
  • 举报
回复
已解决 谢谢大大 <select id="friendsList" parameterClass="String" resultMap="friendsMap"> select username,nicname from appaccount where id in (select otherid from friends where localid=( select id from appaccount where username='yamma1' ) ) or id in (select localid from friends where otherid=( select id from appaccount where username='yamma1' ) ) </select>
X战猫 2013-04-25
  • 打赏
  • 举报
回复
运行后返回1 与表中吻合
WWWWA 2013-04-25
  • 打赏
  • 举报
回复
检查 select id from appaccount where username=#user# 返回结果

56,679

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧