I have two tables Say Table-A and Table-B
Table-A id | Article Name |date 1 | ABC | 25/2/2011 2 | xyz | 26/2/2011 Table-B id | Comment
Something like this should do (untested, not at home):
SELECT Table-A.id, Table-A.article-name, Table-A.date, (SELECT COUNT(id) FROM Table-B WHERE Article-id=Table-A.id) AS NumberOfComments FROM Table-A;