好吧,我想我錯過了一個組或什麼,基本上我需要添加,但不知道如何做我提供添加行或加入它們。MySQL查詢JOIN沒有真正加入
這裏是我的查詢
SELECT * FROM approved_business, business_stores, Real_Cash_Offers
WHERE approved_business.id = business_stores.business_id
AND Real_Cash_Offers.storeid IN (business_stores.storeid)
ORDER BY `approved_business`.`id` ASC
這裏是輸出
1249 Jaggers Hair and Beauty 2012-01-22 19:11:05 1249 1 6139646071 112 Bridge Street Eltham 1 3095 Let Jagger Hair and Beauty set you up with the hot... 1372 1 50|5 2012-01-22 19:11:05
1249 Jaggers Hair and Beauty 2012-01-22 19:11:05 1249 1 6139646071 112 Bridge Street Eltham 1 3095 Let Jagger Hair and Beauty set you up with the hot... 1372 1 100|10 2012-01-22 19:11:05
1249 Jaggers Hair and Beauty 2012-01-22 19:11:05 1249 1 6139646071 112 Bridge Street Eltham 1 3095 Let Jagger Hair and Beauty set you up with the hot... 1372 1 250|30 2012-01-22 19:11:05
我想是讓報價成爲一個數組或東西,所以只有一行。
NEW CODE
發現錯誤的JOIN SQL CODE
SELECT * FROM approved_business, business_stores, Real_Cash_Offers
WHERE approved_business.id = business_stores.business_id
AND Real_Cash_Offers.business_id = approved_business.id
AND Real_Cash_Offers.storeid = business_stores.storeid
ORDER BY `approved_business`.`id` DESC
OUTPUT
id tradingname listed business_id storeid phone street suburb state postcode discription business_id storeid offer tstamp
2582 Deeply Skin Medi Spa 2012-01-22 19:11:05 2582 1 0388224001 Suite 3 , 616 Park Rd Park Orchard 1 3114 2582 1 370|5 2012-01-22 19:11:05
2582 Deeply Skin Medi Spa 2012-01-22 19:11:05 2582 1 0388224001 Suite 3 , 616 Park Rd Park Orchard 1 3114 2582 1 570|10 2012-01-22 19:11:05
2582 Deeply Skin Medi Spa 2012-01-22 19:11:05 2582 1 0388224001 Suite 3 , 616 Park Rd Park Orchard 1 3114 2582 1 1570|15 2012-01-22 19:11:05
請出示你想要的輸出是什麼樣子的例子,而當前的SQL輸出的列名 –