作为 SQL 新手,我的查询存在问题,我确信有一个简单的解决方案。我正在尝试为特定时期的商品销售报告,如果没有销售,我需要显示 0 或空单元格。相反,我根本没有显示项目。当前查询是:
SELECT stock.stock_item_code, stock.physical_quantity, sales.quantity
FROM stock_branch_level AS stock LEFT OUTER JOIN
booked_sales AS sales ON stock.stock_item_code = sales.stock_item_code
WHERE (stock.replen_type = 1) AND (sales.created_date > @DateFrom)
谢谢