我收到错误代码“#1241:操作数应包含 1 列”。该代码工作过一次,但我没有改变它。但现在它不再起作用了。
问题是什么?这与 IN 运算符有关。
代码如下:
SELECT DISTINCT
composition.compartikelnr,
composition.artikelnr,
aantal
FROM
webshops.composition
WHERE
composition.compartikelnr IN (
SELECT
producten.artikelnr,
producten.merk,
producten.producttype,
producten.naam,
producten.hoeveelheid,
producten.eenheid,
producten.kleur,
prodprice.eurotoner,
producten.ean,
producten.seourl,
image.image,
producten.staat,
producten.huismerk,
producten.shopping
FROM
webshops.producten
LEFT JOIN
webshops.prodprice
ON producten.artikelnr = prodprice.artikelnr
LEFT JOIN (SELECT * FROM webshops.prodimage WHERE priority = 1) image ON producten.artikelnr = image.artikelnr
WHERE
image.image <> '' AND
producten.active = 1 AND
producten.ean <> '' AND
producten.shopping = 1
) AND
composition.artikelnr IN (
SELECT
producten.artikelnr,
producten.merk,
producten.producttype,
producten.naam,
producten.hoeveelheid,
producten.eenheid,
producten.kleur,
prodprice.eurotoner,
producten.ean,
producten.seourl,
image.image,
producten.staat,
producten.huismerk,
producten.shopping
FROM
webshops.producten
LEFT JOIN webshops.prodprice ON producten.artikelnr = prodprice.artikelnr
LEFT JOIN (SELECT * FROM webshops.prodimage WHERE priority = 1) image ON producten.artikelnr = image.artikelnr
WHERE
image.image <> '' AND
producten.active = 1 AND
producten.ean <> '' AND
producten.shopping = 1
)