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, 06:58 AM
By lightningtechie in forum Database
Last Post: 02-07-2006, 09:34 AM
By Daniel Reber in forum VB Classic
Last Post: 09-16-2002, 03:50 PM
By Ken D. in forum VB Classic
Last Post: 09-04-2002, 12:25 AM
By Jeff Johnson in forum Database
Last Post: 04-30-2001, 03:42 PM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL