Rey T Timillar
Rey T Timillar

Reputation: 9

1242 - Subquery returns more than 1 row 1

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

Answers (1)

Damien H
Damien H

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

Related Questions