    select		
 		@firstselectposted = c.LastPosted
 	from
-    [{databaseOwner}].[{objectQualifier}Topic] c 
-	JOIN [{databaseOwner}].[{objectQualifier}User] b 
-		ON b.UserID=c.UserID 
-	JOIN [{databaseOwner}].[{objectQualifier}Forum] d 
-		ON d.ForumID=c.ForumID
+    [{databaseOwner}].[{objectQualifier}Topic] c
 	WHERE c.ForumID = @ForumID	    
 	AND	(( (@shiftsticky = 1) and (Priority>0 AND c.Priority<>2)) OR (c.Priority <=0 AND c.LastPosted>=@Date )) 
 		AND	(c.Flags & 8) <> 8

	-- find total returned count
		select
		@post_totalrowsnumber = COUNT(c.TopicID)
	FROM [{databaseOwner}].[{objectQualifier}Topic] c JOIN [{databaseOwner}].[{objectQualifier}User] b 
		ON b.UserID=c.UserID 
	JOIN [{databaseOwner}].[{objectQualifier}Forum] d 
		ON d.ForumID=c.ForumID
	WHERE c.ForumID = @ForumID
		AND	((Priority>0 AND c.Priority<>2) OR (c.Priority <=0 AND c.LastPosted>=@Date )) 
		AND	(c.Flags & 8) <> 8

   declare @post_priorityrowsnumber int
   declare @post_priorityrowsnumber_shift int
   declare @firstselectrownum int 
   declare @sortsincelatest int
  
   declare @firstselectposted datetime 
   declare @ceiling decimal
