0
我有兩個表這樣子查詢問題
會員和他們的購買
我需要這樣的
Member_ID | CountofProducts
輸出(和產品價值,不應該是0和採購狀態= 1)
SELECT
MemberName,
(SELECT COUNT(*) AS Count
FROM dbo.Purchases
WHERE MemberName = dbo.Members.MemberName
AND Res_Status = 1) AS Count
FROM
dbo.Members
我可以得到從上述查詢它們的總CountofPurchased Products
但我孃家d要避免他們的count=0
該怎麼辦?