OK私は3つのテーブルを持っています.1つは製品を含み、1つは注文を含み、テーブルを注文IDと製品IDと結合して製品を注文に関連付けます。
しかし、すべての注文と各注文内のアイテムを選択して返すクエリをどのように設定すればよいでしょうか。したがって、各行に order_items という列があります。
これまでのところ、私は持っています:
SELECT
intOrderID AS Order_ID,
strPaymentMethod AS Payment_Method,
strPaymentRef, AS Payment_Ref,
strPaymentStatus AS Payment_Status,
dtmDate AS Date,
curPaymentAmount AS Net_Price,
curShippingFee AS Shipping_Fee
FROM tbl_mod_ShopOrders
他のテーブルはtbl_mod_ShopOrderItems
、選択する必要があります
intProductID
strProductTitle
curPrice
intQty
注文内の各アイテム。
ある種のサブクエリを実行する必要があることはわかっていますが、その作成方法に注意してください。