SELECT xp.productid, xp.product, xc.classid, xiW.date, xco.optionid, xco.option_name, xiW.id, xiW.image_path, xiW.path_on_server
FROM xcart_products xp
INNER JOIN xcart_variants xv ON xp.productid = xv.productid
INNER JOIN xcart_variant_items xvi ON xv.variantid = xvi.variantid
INNER JOIN xcart_class_options xco ON xvi.optionid = xco.optionid
INNER JOIN xcart_classes xc ON xco.classid = xc.classid AND xc.class = 'COLOR'
LEFT JOIN xcart_images_W xiW ON xiW.id = xvi.variantid
GROUP BY xco.optionid
ORDER by xp.product ASC
次のエラーが表示されます: xp.productid は GROUP BY にありません
次に、それを追加して、XP.product is not in GROUP BY を取得します
それを追加すると、xc.classid is not in GROUP BY が取得されます
私はそれを追加して、ずっと下に行きます-
SELECT xp.productid, xp.product, xc.classid, xiW.date, xco.optionid, xco.option_name, xiW.id, xiW.image_path, xiW.path_on_server
FROM xcart_products xp
INNER JOIN xcart_variants xv ON xp.productid = xv.productid
INNER JOIN xcart_variant_items xvi ON xv.variantid = xvi.variantid
INNER JOIN xcart_class_options xco ON xvi.optionid = xco.optionid
INNER JOIN xcart_classes xc ON xco.classid = xc.classid AND xc.class = 'COLOR'
LEFT JOIN xcart_images_W xiW ON xiW.id = xvi.variantid
GROUP BY xco.optionid, xp.productid, xp.product, xc.classid, xiW.date, xco.option_name, xiW.id, xiW.image_path, xiW.path_on_server
ORDER by xp.product ASC
これは正しくありませんよね?それは実行されますが、GROUP BY は MySQL 5 と 4 では少し異なる方法で処理されると思いますか、それとも私のクエリは 4 ではほとんど機能しませんでしたか?