ここに 3 つのクエリを投稿しました。実際には、1番目と2番目のクエリに参加したいです。2番目のクエリ結果セットとともにsc.messageの結果を取得したいので。#1242エラーを超える3番目のクエリを確認してください。ガイドしてください...
Query1=(SELECT sc.message
FROM sales_flat_order sfo, `sales_flat_order_item` `sfoi`
LEFT JOIN `shipping_comment` `sc` ON
`sfoi`.`shipping_comment_id` = `sc`.`shipping_comment_id`
WHERE sfoi.order_id = sfo.entity_id
AND sfo.increment_id = 100000429)
Query2= (SELECT sfoi.name, sfoi.sku, sfoi.qty_ordered, sfoi.price, sfoi.row_total, sfo.base_subtotal,
sfo.base_shipping_amount, sfo.base_grand_total
FROM sales_flat_order sfo
JOIN sales_flat_order_item sfoi
ON sfoi.order_id = sfo.entity_id
WHERE sfo.increment_id = 100000429)
Query3 = SELECT sfoi.name, sfoi.sku, sfoi.qty_ordered, sfoi.price, sfoi.row_total, sfo.base_subtotal,
sfo.base_shipping_amount, sfo.base_grand_total,
(SELECT sc.message
FROM sales_flat_order sfo, `sales_flat_order_item` `sfoi`
LEFT JOIN `shipping_comment` `sc` ON `sfoi`.`shipping_comment_id` = `sc`.`shipping_comment_id`
WHERE sfoi.order_id = sfo.entity_id
AND sfo.increment_id = 100000429)
FROM sales_flat_order sfo
JOIN sales_flat_order_item sfoi
ON sfoi.order_id = sfo.entity_id
WHERE sfo.increment_id = 100000429
それでは、これを解決する方法を教えてください。
みんな、私は問題を解決します-:
SELECT sfoi.name, sfoi.sku, sfoi.qty_ordered, sfoi.price,
sfoi.row_total, sfo.base_subtotal, sfo.base_shipping_amount,
sfo.base_grand_total,sc.message
FROM sales_flat_order sfo
JOIN sales_flat_order_item sfoi
ON sfoi.order_id = sfo.entity_id
LEFT JOIN `shipping_comment` `sc`
ON `sfoi`.`shipping_comment_id` = `sc`.`shipping_comment_id`
WHERE sfo.increment_id = 100000429