Create TotalCountQuery