I tried it. I ve got a table UACCESSRIGHT with two integer fields, one of them being RIGHTID, randomly populated.
select *, %vid from (select * from UACCESSRIGHT) worked
however, this approach is not of much use without having the possibility to order the results, so I tried:
select *, %vid from (select * from UACCESSRIGHT order by RIGHTID) failed on wrong syntax
select *, %vid from (select * from UACCESSRIGHT) order by RIGHTID gave result set, but a wrong one (%vid was NOT 100% correlated with RIGHTID, that is the order specified by %vid was different than order specified by RIGHTID value)
is there any usable way to paginate the ordered sets?
Thank you! I missed the TOP clause. It is somewhat counterintuitive, but it IS mentioned in the documentation, though. Do you think that the form
select *, %vid from (select TOP 20 * from UACCESSRIGHT order by RIGHTID) where %vid>=10
(which give the same result) would be more effective?