我有以下查询:MySQL的子查询返回多个1行
(select xyz.* from
(select xt.image, p.*, pc.categoryid, c.category,
(select value from xcart_extra_field_values
where efv.productid=p.productid and efv.fieldid = 2) as Type,
(select value from xcart_extra_field_values
where efv.productid=p.productid and efv.fieldid = 1) as Zone
FROM xcart_products p
inner join xcart_products_categories pc
on p.productid=pc.productid
inner join xcart_categories c
on pc.categoryid=c.categoryid
inner join xcart_extra_field_values efv
on p.productid=efv.productid
inner join xcart_images_T xt
on p.productid=xt.id) xyz
where categoryid='1' and Type='2' and Zone='1'
group by productid)
但是,当我在phpMyAdmin执行这个查询它会显示一个错误messgae:
#1242 - Subquery returns more than 1 row
哪些错误查询。请帮忙。提前致谢。
Thakns为您解答。这是问题所在,我为两个子查询使用了相同的别名。 –