Skip to content
Advertisement

SQL: How to select 1st, 3rd, 11th and nth row from a table?

How to select 1st, 3rd, 11th and nth row from a table?

Advertisement

Answer

If there is a primary key defined for the table that is an integer based data type–both MySQL and SQLite have auto_increment for example–then you can use:

…where id is the auto_increment column.

There’s very little detail to go on, but MySQL and SQLite do not have analytic query support, making queries rather complicated:

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement