Compare two tables count the replies and display in asp.net
i have an two table question ,replies in asp.net using sql server 2005 ,if i got reply for that question,replies are added to the reply table in question table i specify that that id are auto increment so, i want to specify the number of replies for each questions,
give any ideas to do this,
Thank u,
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Madhu KRank #1,514 · 1.1K reputationPosted Jan 11, 2011, 8:09 PM EST
table1
AutoID Question
1 question1
2 question2
table2
AutoID questionID Answer
1 1 Answer1
2 1 Answer2
3 2 Answer2
select count(questionID) from table2 where questionID=1
which gives number of replies for question1.
krithika muthukrishnanRank #8,369 · 223 reputationPosted Jan 11, 2011, 8:39 PM EST
Thank u ,for ur answer but it display for one question only,
with in a sigle query i want to display the number of replies for all the questions