i have table thread(tblthread) which has following colmns(Thread_Id,Forun_Id,Thread_Topic,Thread_Description)
in my Forums.aspx in data grid i want to display number of threads in each forum,like
what sqlquery i have to write,iam little bit confused
how to get count of threads in each forum.
Group by Forum_Id
i did that and i have the answer but the problem is
the sqlquery which displays the Forum name from (tlbforum) and username from (tbluser_profile)is
sqlQry1="select tblforum.*,tbluser_profile.Nick_Name AS owner,Count(tblthread.Thread_Id)
FROM tblforum INNER JOIN tbluser_profile ON tblforum.User_Id = tbluser_profile.User_Id ORDER BY tblforum.Creation_Date DESC"
now the query which gives me the number of Threads in each forum is
sqlQry2="SELECT count(tblthread.Thread_Id) , tblthread.Forum_Id
FROM tblthread INNER JOIN
tblforum ON tblthread.Forum_Id = tblforum.Forum_Id
GROUP BY tblthread.Forum_Id"
now how to club sqlQry1 and sqlQry2 into one query so that my Datagrid displays
Thread name,thread initiated by,last post in the thread by.
By vaibhavpingle in forum Java
Last Post: 11-30-2006, 05:58 AM
By lightningtechie in forum Database
Last Post: 02-07-2006, 08:34 AM
By Daniel Reber in forum VB Classic
Last Post: 09-16-2002, 02:50 PM
By Ken D. in forum VB Classic
Last Post: 09-03-2002, 11:25 PM
By Jeff Johnson in forum Database
Last Post: 04-30-2001, 02:42 PM
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center