SELECT
p.name AS pname,
p.icon AS icon,
p.price AS price,
p.original_price AS original_price,
p.prod_id AS prod_id,
p.stock AS stock,
p.views AS views,
s.name AS sname
FROM `product` as p
JOIN
`store` as s ON p.store_id = s.store_id
WHERE
p.active = '1'
ORDER BY `prod_id` DESC
當 s.store_id 移除之後
這一段查詢就完全錯誤了
有什麼改寫方式
可以即便 s.store_id 移除,仍然可以顯示數據?
假設五件商品
有兩件 store_id 的值變空了
此時執行這個語句,只會顯示三筆,其他兩筆會消失,這要怎麼解?我想讓他顯示?
12345678_0001