I have results set with 200 rows. i need to mange paging in SQL SERVER. means, that every page need to retrieve 15 rows per page (14 pages overall, 13 with full 15 rows and one page with 5 rows). but, inside the results set, i need to check if specific ID exist, if so, i need to push him to the first page(the first 15 rows) In addition, the same row must also appear first (top 1) in the first page.
All the ID's in the results set must be unique.
Please note that the number of rows are dynamic as well as the number of pages (this is just an example)