2015-11-18 69 views

回答

4

聚集和COUNT應該是足夠了:

SELECT A.ID, A.Date, COUNT(c.ID) AS Comments 
FROM Article A 
LEFT JOIN Comment c 
    ON A.id = c.FK_Article 
GROUP BY A.ID, A.Date 
ORDER BY A.ID; 
+0

@PinnyM是的,你是對的:) THX – lad2025

+1

大,它的工作原理,看起來容易,比我的預期。非常感謝你 :) – Bullman

相關問題