访问'在'查询之间选择行'

时间:2013-09-16 11:18:13

标签: sql ms-access

我在访问时有一个基本查询。 SQLlook像:

SELECT tblAssignedWords.ChildID, tblAssignedWords.Child, tblAssignedWords.WordID, tblAssignedWords.Word, tblAssignedWords.Status, tblAssignedWords.WordDifficulty, tblAssignedWords.WeekNumber
FROM tblAssignedWords
WHERE (((tblAssignedWords.ChildID)=1));

这可以记录70条记录。我只想看到10到20行之间的记录(总共10条记录)。是否有我可以用来查看这些行的SQL语句?

由于

克雷格

2 个答案:

答案 0 :(得分:2)

排序。您需要对排序进行一些衡量。我假设这是WordId

SELECT top 10 *
from (SELECT top 20 aw.ChildID, aw.Child, aw.WordID, aw.Word, aw.Status,
             aw.WordDifficulty, aw.WeekNumber
      FROM tblAssignedWords aw
      WHERE aw.ChildID = 1
      ORDER BY WordId
     ) t
ORDER BY WordId Desc;

答案 1 :(得分:0)

SELECT tblAssignedWords.ChildID, tblAssignedWords.Child, tblAssignedWords.WordID, tblAssignedWords.Word, tblAssignedWords.Status, tblAssignedWords.WordDifficulty, tblAssignedWords.WeekNumber
FROM tblAssignedWords
WHERE tblAssignedWords.ChildID between 10 and 20

使用此