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,
krithika muthukrishnanPosted Jan 12, 2011, 1:39 AM
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
Madhu KPosted Jan 12, 2011, 1:09 AM
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.