如何在SQL数据库中使用SELECT语句根据序列检索记录 [英] How to use SELECT statement in SQL database to retreive records based on their sequence

查看:137
本文介绍了如何在SQL数据库中使用SELECT语句根据序列检索记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个使用SQL数据库的数据库程序,我不能依赖于SELECT语句中的ID列或任何其他列,因为我没有使用像(SELECT * FROM table1)这样的东西

而不是我希望直接从数据库文件中获取数据库中的每一行,而不是将整个数据库下载到内存中,这将使程序和计算机变慢。



所以我想知道是否有一种方法可以根据记录的数量或顺序从SQL数据库中检索记录 - 请记住,我不能使用ID列或列作为主键 - ?



注意:我使用的是visual studio(C#)框架。

I am building a database program that uses an SQL database and I can't rely on an ID column or any other column in the SELECT statement, because I am not using something like (SELECT * FROM table1)
instead i want each row in the database to be fetched directly from the database file not to download the entire database into the memory which will make the program and the computer slow.

so I want to know if there is a method to retrieve records from an SQL database based on the number or sequence of the record - PLEASE remember that I can't use an ID column or a column to use as a primary key-?

NOTE : I am using visual studio (C#) framework.

推荐答案

检查本文

SQL Server 2005分页结果 [ ^ ]


这篇关于如何在SQL数据库中使用SELECT语句根据序列检索记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆