#1241-operand should contain 1 column (s)
SELECT O. * , (
SELECT COUNT (*)
From Purn_order_product as Op
WHERE Op.op_oordernum = O.o_num
) as OP_CNT, (
SELECT *
From Purn_order_product as Op
INNER JOIN purn_product as P on (p.p_it = Op.op_pcode)
WHERE Op.op_oordernum = O.o_num
ORDER by Op.op_uid ASC
LIMIT 1
) as P_info
From Purn_order as O
ORDER by O_rdate DESC
LIMIT 0, 50
Excuse me,
The above SQL statement prompts an error:
#1241-operand should contain 1 column (s)
How does this work?
Please give me some details.
Thank you
------to solve the idea----------------------
SELECT O. * ,
(SELECT count (*) from Purn_order_product as op WHERE op.op_oordernum = o.o_num) As OP_CNT,
(SELECT *From Purn_order_product as op INNER joins purn_product as P on (p.p_it = Op.op_pcode)
WHERE p.op_oordernum = O.o_num ORDER by op.op_uid ASC LIMIT 1) As P_info
From Purn_order as O
ORDER by O_rdate DESC
LIMIT 0, 50
There's a problem with the set broken place!
You can't assign multiple fields to an alias, which logically doesn't make sense.
That one *Should, and can only be a definite column name
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.