Select from table

StewartBW 705 Reputation points
2024-05-24T00:46:41.91+00:00

Hello

Using Access mdb with OleDbRader (Access Database Engine) to select all:

"SELECT * FROM tabke WHERE clmn = 'blah'"

This might return 100 items, how can I use select to read from number 5 to 50, for example?

Possible?

Thank you all

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,524 questions
VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,636 questions
{count} votes

Accepted answer
  1. Jiachen Li-MSFT 27,836 Reputation points Microsoft Vendor
    2024-05-24T02:17:25.3433333+00:00

    Hi @StewartBW ,

    Select the top 50 data and exclude the first four data.

    SELECT * 
    FROM (
        SELECT TOP 50 * 
        FROM tabke 
        WHERE clmn = 'blah' 
        ORDER BY some_column
    ) AS temp 
    WHERE some_column NOT IN (
        SELECT TOP 4 some_column 
        FROM tabke 
        WHERE clmn = 'blah' 
        ORDER BY some_column
    )
    
    

    Best Regards.

    Jiachen Li


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful