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 的值變空了此時執行這個語句,只會顯示三筆,其他兩筆會消失,這要怎麼解?我想讓他顯示?
- 1 回答
- 0 关注
- 344 浏览
添加回答
举报
0/150
提交
取消