tag:blogger.com,1999:blog-497787815177352569.post622873745294976072..comments2024-01-03T08:55:04.827-05:00Comments on SQL Anywhere: Scrolling In A Partition: Is There A Better Way?Breck Carterhttp://www.blogger.com/profile/15975598564711761434noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-497787815177352569.post-55461931840883582912011-08-10T17:24:55.445-04:002011-08-10T17:24:55.445-04:00Note, this is untested and therefore just a sugges...Note, this is untested and therefore just a suggestion to simplify the query. I can't claim if it does work at all - and if it does, whether it does perform better.<br /><br />That being said, isn't TOP with the START AT clause helpful here (as to the docs the more appropriate "FIRST START AT" is not supported):<br /><br />Such as<br /><br /><i><br />SELECT TOP 1 START AT 100 t.primary_key AS destination_primary_key<br />FROM t<br />WHERE t.partition_id = @partition_id<br /> AND t.primary_key > @current_primary_key<br />ORDER BY t.primary_key ASC<br /></i><br /><br />Just my 0.5 cents<br /><br />VolkerAnonymousnoreply@blogger.com