Ideally I need a query that is equivalent to
select * from customer where row_number() = 3
but that\'s illegal.
I can\'t u
SQL tables are not ordered by default, and asking for the n-th row from a non ordered set of rows has no meaning as it could potentially return a different row each time unless you specify an ORDER BY:
select * from customer order by id where row_number() = 3
(sometimes MySQL tables are shown with an internal order but you cannot rely on this behaviour). Then you can use LIMIT offset, row_count, with a 0-based offset so row number 3 becomes offset 2:
select * from customer order by id
limit 2, 1
or you can use LIMIT row_count OFFSET offset:
select * from customer order by id
limit 1 offset 2