如何从数据库中的表中检索特定的行数 [英] How to retrieve specific count of rows from table in database
本文介绍了如何从数据库中的表中检索特定的行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
在数据库中,如果我有超过100行的雇员表,
而且我只想获取41到50的行.
我尝试这个:
Hi guys,
In Database, if i have Employees table which has more than 100 rows,
and i want to get rows form 41 to 50 only.
I try this:
select EmployeesName,EmployeesSalary from EmployeesTable
但它返回表中的所有行
我不能在where子句中使用EmployeesID,因为它没有排序,因为从表中删除了一些行,例如,EmployeesID可以像这样:
1,2,4,5,6,8,10,13,14,15有3,7,9,11,12被删除
所以,我不能依靠它
然后,我该怎么办?
but it return all rows from table
I can not used EmployeesID in where clause because it not ordered as there are rows deleted from table as example EmployeesIDs can be like this:
1,2,4,5,6,8,10,13,14,15 There are 3,7,9,11,12 are deleted
So, i cannot depend on it
Then, what can i do ?
推荐答案
看看发布的解决方案 ^ ].
Take a look at the solutions posted here[^].
这篇关于如何从数据库中的表中检索特定的行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文