更新时间:2023-12-01 11:05:40
您应该能够使用 LEFT JOIN 来实现这一点.
You should be able to use a LEFT JOIN to achieve this.
SELECT a.id AS stock, COALESCE(b.quanitity,0), b.product_id, a.name AS stock_fullname
FROM a
LEFT JOIN b
ON a.id = b.stock_id
AND b.product_id = 13