Quote
// Use this for pagination
$criteria=new CDbCriteria();
$count=carManager::model()->count($criteria);
$pages=new CPagination($count);
// Results per page in pagination
$pages->pageSize=10;
$pages->applyLimit($criteria);
// SQL
SELECT id FROM cars LIMIT $criteria->offset,$criteria->limit
$criteria=new CDbCriteria();
$count=carManager::model()->count($criteria);
$pages=new CPagination($count);
// Results per page in pagination
$pages->pageSize=10;
$pages->applyLimit($criteria);
// SQL
SELECT id FROM cars LIMIT $criteria->offset,$criteria->limit
However, this does not work in MSSQL 2008 as it does not have support for LIMIT. Can you please advise how to do pagination with MSSQL? Note that using TOP is not interesting as that will only return the N defined number of results. What I need is to retrieve results between 1-10, 11-20 etc.

Help











