Nested query in Sql.
x
SELECT
*,
(SELECT `supplier_sign_up_id`,
(
SELECT
email_address
FROM
supplier_sign_up
WHERE
supplier_sign_up_id = 42 LIMIT 1
)
FROM
`suppliers_acc`
WHERE
singup_login_id = 138 LIMIT 1
)
FROM
`singup_login`
WHERE
1;
It’s give error-
Operand should contain 1 column(s).
How to resolve it.
Advertisement
Answer
Try This,
SELECT *,
(SELECT `supplier_sign_up_id` FROM suppliers_acc WHERE singup_login_id = 138 LIMIT 1) as supplier_sign_up_id ,
(SELECT `email_address` FROM supplier_sign_up WHERE supplier_sign_up_id = 42 LIMIT 1 ) as email_address
FROM
`singup_login`
WHERE
1;