Reputation: 9
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
Upvotes: 0
Views: 64
Reputation: 174
Looks like you're trying to select 3 columns in your sub-queries - and then trying to express them as single columns.
If I recall correctly, you can't put three columns (e.g. 'BrndName,Modname,Capacity') into one column (e.g. 'crevrtv') without concatenating them first, so MySQL is informing you of that fact.
You're also trying to return two columns with the alias 'crevrtv'.
Upvotes: 1