同步sqlServer表数据分页查询sql

 SELECT TOP ${pageSize}
             *
        FROM
                ( SELECT row_number ( ) OVER ( ORDER BY Apply_DateTime ASC ) AS rownumber,* FROM PatientApply where SelectVisit_Id != '' and Apply_DateTime >= #{lastDate}) temp_row
        WHERE
            rownumber > ((${front}-1)*${pageSize}) and rownumber <= (${front}*${pageSize})

此sql的front从1开始

你可能感兴趣的:(数据库)