操作方法在特定表上按范围选择查询范围

时间:2015-05-27 15:40:00

标签: sql database sybase sybase-ase

我有一个temp_table,包含超过80K的行。 在aqua中,由于空间/内存限制,我无法在此桌上选择*。

select * from #tmp

有没有办法按范围选择查询范围?

例如: - 给我前10000条记录,下一条10000和下一条10000直至结束。

注意: -

   1) I am using Aqua Data Studio, where I am restricted to select max 5000 rows in one select query.

   2) I am using Sybase, which somehow doesn't allow  'except' and 'select top @var from table' syntax and ROWNUM() is not avaliable

谢谢!

3 个答案:

答案 0 :(得分:0)

你能不能在表格

中使用where where子句
select top n * from table where some_id > current_iteration_starting_point

e.g

select top 200 * from tablename where some_id >  1 

并继续增加iteration_starting_point,在下一次迭代中从1增加到201,依此类推。

答案 1 :(得分:0)

您可以在SQL Server中使用以下内容。只需为每次新迭代更新@FirstRow。

MyAdapter

答案 2 :(得分:0)

相关问题