連接列內多個帳戶,並和值我有3個表SQL SELECT或CROSS通過
Table1APPLES
Table2ORANGES
Table3BANANAS
內的每個表都與一個價格和數量的水果
TABLE1APPLES:
*Fruit* *Price* *Quantity*
----------------------------------------
GreenApple $5 8
RedApple $3 7
TABLE2ORANGES:
*Fruit* *Price* *Quantity*
----------------------------------------
Oranges $3 8
TABLE3BANANAS:
*Fruit* *Price* *Quantity*
----------------------------------------
YellowBanana $5 9
GreenBanana $4 8
我想找到這些水果的每個組合以及總價和數量。
例子:
Fruit Price Quantity Fruit Price Quantity Fruit Price Quantity TotalPrice TotalQuantity
------------------------------------------------------------------------------------------------------------------------
Green Apple $5 8 Orange $3 8 Yellow Banana $5 9 $13 25
Green Apple $5 8 Orange $3 8 Green Banana $4 8 $12 24
Red Apple $3 7 Orange $3 8 Yellow Banana $5 9 $11 24
Red Apple $3 7 Orange $3 8 Green Banana $4 8 $10 23
目前還不清楚你在問什麼。紅蘋果發生了什麼事? – IanS
你需要一個笛卡爾產品。 Google SQL交叉加入。 – PyNoob
@IanS用紅蘋果 –