Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
biswanath23
Starting Member
4 Posts |
Posted - 2009-07-31 : 01:35:25
|
| Select ForumTypeDetails.ForumTypeID,max(forumdetails.date) as Date,ForumTypeDetails.ForumName,ForumTypeDetails.ForumDetails,count(forumdetails.ForumTypeID)as Posting,forumdetails.userIDFrom ForumTypeDetailsLeft Join forumdetailsOn forumdetails.ForumTypeID =ForumTypeDetails.ForumTypeID and forumdetails.ParentID=0Group by ForumTypeDetails.ForumTypeID,ForumTypeDetails.ForumTypeID,ForumTypeDetails.ForumName,ForumTypeDetails.ForumDetails,forumdetails.userIDTable:forumdetails >> MessageID,ParentID,userID,Subject,Message,Date,IsBlocked,ForumTypeIDTable:ForumTypeDetails >>ForumTypeID,ForumName,ForumDetails,IsBlockedi also want to count the reply under the Posting in a single query(other fields are also needed),can any one help me !!Thanks . |
|
|
Sachin.Nand
2937 Posts |
Posted - 2009-07-31 : 03:13:07
|
| Is it giving some error or the resultset is wrong?Please post some sample data?PBUH |
 |
|
|
biswanath23
Starting Member
4 Posts |
Posted - 2009-07-31 : 03:18:42
|
quote: Originally posted by Idera Is it giving some error or the resultset is wrong?Please post some sample data?PBUH
No it dont gives any error . I need to count the message , threads with other query ! |
 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2009-07-31 : 03:24:22
|
| What do u mean by this requirement "reply under the Posting in a single query "?I could not see any column name as "Posting".PBUH |
 |
|
|
biswanath23
Starting Member
4 Posts |
Posted - 2009-07-31 : 03:31:44
|
quote: Originally posted by Idera What do u mean by this requirement "reply under the Posting in a single query "?I could not see any column name as "Posting".PBUH
the main thing is I need to Count the Total THREAD after that NEED to count the message under each THREAD . LIKE this forum . |
 |
|
|
Sachin.Nand
2937 Posts |
Posted - 2009-07-31 : 03:49:22
|
| Select ForumTypeDetails.ForumTypeID,max(forumdetails.date) as Date,ForumTypeDetails.ForumName,ForumTypeDetails.ForumDetails,count(forumdetails.ForumTypeID)as Posting,forumdetails.userIDFrom ForumTypeDetailsLeft Join forumdetailsOn forumdetails.ForumTypeID =ForumTypeDetails.ForumTypeID and forumdetails.ParentID=0Group by ForumTypeDetails.ForumTypeID,ForumTypeDetails.ForumTypeID,ForumTypeDetails.ForumName,ForumTypeDetails.ForumDetails,forumdetails.userIDWITH ROLLUPPBUH |
 |
|
|
|
|
|
|
|