We are using common table expressions to temporarily save the search results.
WITH Results (
------
)
AS
(
select ---
)
SELECT * FROM Results
WHERE Results.RowNum BETWEEN @StartIndex + 1 AND @StartIndex + @MaxCount
Here i want to get the toatal number of records in the Results common table expression in a variable @RowCount. Is there any way to get it without using table variable or temp table.
