1242 - 子查询返回多于1行1

时间:2014-09-26 06:44:44

标签: mysql

SELECT
dept.deptname,details.UserName,
(select CONCAT(BrndName,' - ',ModName,' - ',Capacity) from details where  Devname='PROCESSOR' ) as Processor,
(select CONCAT(BrndName,' - ',ModName,' - ',Capacity) from details where  Devname='PROCESSOR' ) as Memory
FROM
dept
LEFT JOIN details ON dept.deptcode = details.DeptCode

1 个答案:

答案 0 :(得分:1)

您似乎在尝试在子查询中选择3列 - 然后尝试将它们表示为单列。

如果我没记错的话,你不能将三列(例如'BrndName,Modname,Capacity')放入一列(例如'crevrtv')而不先连接它们,所以MySQL会告诉你这个事实。

您还尝试使用别名'crevrtv'返回两列。