I have this mssql request:
with RESULT as(select TITLE, URL, ROW_NUMBER() over (order by URL) as SeqValue from WEBSITE select * from RESULT where SeqValue>=20 and SeqValue<=40
I would like to know how many records will be returned in this request if there were not there. I try with select count(*) from RESULT and try with @@ROWCOUNT and many other ways, but it does not work. I need a TITLE and a URL from select, and in the end I need a complete entry to select.
For example, in a mysql query, I have prepareStatement using SQL_CALC_FOUND_ROWS :
select SQL_CALC_FOUND_ROWS TITLE, URL from WEBSITE limit ?, ? and after this select i have: select FOUND_ROWS()
In this example, the return value is a common entry for the mysql query. The general record is the same as LIMIT without the LIMIT directive. I am converting a database from mysql to mssql and I have a problem with this. Please help me...
source share