SELECT *
FROM (
SELECT
@row := @row +1 AS rownum, [column name]
FROM (
SELECT @row :=0) r, [table name]
) ranked
WHERE rownum % [n] = 1
More Related Contents:
- SQL select only rows with max value on a column [duplicate]
- How to create a MySQL hierarchical recursive query?
- What is the error “Every derived table must have its own alias” in MySQL?
- MySQL Error 1215: Cannot add foreign key constraint
- Generating Depth based tree from Hierarchical Data in MySQL (no CTEs)
- Authentication plugin ‘caching_sha2_password’ cannot be loaded
- How to grant remote access permissions to mysql server for user?
- mySQL convert varchar to date
- Generating a series of dates [duplicate]
- How to take backup of a single table in a MySQL database?
- Add Foreign Key to existing table
- Auto Generate Database Diagram MySQL [closed]
- MySQL maximum memory usage
- MySQL JOIN the most recent row only?
- What does SQL clause “GROUP BY 1” mean?
- Bogus foreign key constraint fail
- INSERT … ON DUPLICATE KEY UPDATE with WHERE?
- Error #2002 Can’t connect to local MySQL server through socket ‘/Applications/MAMP/tmp/mysql/mysql.sock’ (2)
- Syntax error when using except in a query
- Easiest way to copy a table from one database to another?
- Using index, using temporary, using filesort – how to fix this?
- sql like operator on integer
- How to get the max of two values in MySQL?
- How to connect locally hosted MySQL database with the docker container
- How to make a primary key start from 1000?
- MySQL – SELECT * INTO OUTFILE LOCAL ?
- The best way to remove value from SET field?
- how to partition a table by datetime column?
- Count duplicates records in Mysql table?
- Errno 121, duplicate key on write or update?