SQL queries that do not work under SQLite in a C# application

Edouard Durand 1 Reputation point
2021-10-17T16:03:33.067+00:00

Hello,

I am developing an application in C# with WinForms using SQLite as a database.
The problem, is that I realize that some SQL queries do not work with SQLite.

For example, the SQL commands below do not work with SQLite.

SELECT TOP 50 * FROM Movies ORDER BY MoviesId;

SELECT TOP 100 * FROM Movies WHERE MoviesId NOT IN (SELECT TOP 50 MoviesId FROM Movies ORDER BY MoviesId);

Do you have a variant of these SQL queries that works under SQLite, please?

Thanks.

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,838 questions
Windows 10 Network
Windows 10 Network
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Network: A group of devices that communicate either wirelessly or via a physical connection.
2,276 questions
Windows 11
Windows 11
A Microsoft operating system designed for productivity, creativity, and ease of use.
8,282 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Viorel 112.5K Reputation points
    2021-10-17T16:51:05.337+00:00

    Try these queries:

    SELECT * FROM Movies ORDER BY MoviesId LIMIT 50
    SELECT * FROM Movies ORDER BY MoviesId LIMIT 50 OFFSET 50
    SELECT * FROM Movies ORDER BY MoviesId LIMIT 50 OFFSET 100
    
    1 person found this answer helpful.
    0 comments No comments