You can do it with a sub-query:
SELECT * FROM (
SELECT * FROM table ORDER BY id DESC LIMIT 50
) sub
ORDER BY id ASC
This will select the last 50 rows from table
, and then order them in ascending order.
More Related Contents:
- Which DB technology is sued to solve the following search issue? [closed]
- MyISAM versus InnoDB [closed]
- How to select the nth row in a SQL database table?
- Compare two MySQL databases [closed]
- How should I resolve –secure-file-priv in MySQL?
- What does character set and collation mean exactly?
- What’s faster, SELECT DISTINCT or GROUP BY in MySQL?
- Storing image in database directly or as base64 data?
- Implementation of Levenshtein distance for mysql/fuzzy search?
- Does MySQL ignore null values on unique constraints?
- How do I restore a dump file from mysqldump?
- What’s the difference between MyISAM and InnoDB? [duplicate]
- Maximum length for MySQL type text
- What effects does using a binary collation have?
- MySQL SELECT increment counter
- Hyphens in column names in MySQL DB
- Error Code: 1215. Cannot add foreign key constraint (foreign keys)
- Error renaming a column in MySQL
- Modeling Product Variants
- Mysql database sync between two databases
- How do I get the ID of multiple inserted rows in MySQL?
- What’s the best database structure to keep multilingual data? [duplicate]
- Does mysql have the equivalent of Oracle’s “analytic functions”?
- MySQL concatenating all columns
- Remove special characters from a database field
- Using reserved words in column names
- How big can a MySQL database get before performance starts to degrade
- What is the difference between SQL and MySQL? [closed]
- mysql Failed to read auto-increment value from storage engine
- How to store data with dynamic number of attributes in a database