我试图执行这个查询:嵌套在SQL错误操作数选择应包含1列
select *, (select * from tab1 where tab1.type!="firstype") as P
from tab2 where tab2.attr="something" and tab2.tab1_id=P.id
但我有此错误:
Error Code: 1241. Operand should contain 1 column(s) 0,001 sec
我理解的错误,但不知其所以然出来。 P.id不工作?
不能使用子查询产生的多个列的方式。尝试只选择ID字段。 – 11684 2014-11-05 14:58:28
(即“从tab1 ...中选择ID”)。 – 11684 2014-11-05 14:59:07