Si vous utilisez PostgreSQL, vous pouvez utiliser row_number()
:
SELECT t.*
FROM (
SELECT *, row_number() OVER(ORDER BY id ASC) AS row
FROM yourtable
) t
WHERE t.row % 5 = 0
Si vous utilisez PostgreSQL, vous pouvez utiliser row_number()
:
SELECT t.*
FROM (
SELECT *, row_number() OVER(ORDER BY id ASC) AS row
FROM yourtable
) t
WHERE t.row % 5 = 0