Until MySQL finally supports modern SQL, the only way to get something similar is this:
SELECT @rownum:=@rownum + 1 as row_number,
t.*
FROM (
< your original query goes here >
) t,
(SELECT @rownum := 0) r
More Related Contents:
- In SQL Server how to get the count of child if both parent and child are available [closed]
- How to select the nth row in a SQL database table?
- SQL: Repeat a result row multiple times, and number the rows
- How do I decide when to use right joins/left joins or inner joins Or how to determine which table is on which side?
- Does mysql have the equivalent of Oracle’s “analytic functions”?
- Use Composite Primary Key as Foreign Key
- What does SQL Select symbol || mean?
- MySQL equivalent of Oracle’s SEQUENCE.NEXTVAL
- Why in SQL NULL can’t match with NULL?
- INSERT INTO SELECT statement with more columns which is not in another table
- MySQL how to fill missing dates in range?
- ‘IF’ in ‘SELECT’ statement – choose output value based on column values
- How to split the name string in mysql?
- Why does MySQL allow “group by” queries WITHOUT aggregate functions?
- How to set a maximum execution time for a mysql query?
- SQL keys, MUL vs PRI vs UNI
- How to copy a row and insert in same table with a autoincrement field in MySQL?
- How to move columns in a MySQL table?
- Using group by on two fields and count in SQL
- Can MySQL convert a stored UTC time to local timezone?
- Whats the fastest way to lookup big tables for points within radius MySQL (latitude longitude)
- MySQL CONCAT returns NULL if any field contain NULL
- Does Order of Fields of Multi-Column Index in MySQL Matter
- Alternative to using LIMIT keyword in a SubQuery in MYSQL
- How to get a list of months between two dates in mysql
- My SQL Dynamic query execute and get ouput into a variable in stored procedure
- Postgres LEFT JOIN with WHERE condition
- How to check if field is null or empty in MySQL?
- MySQL OPTIMIZE all tables?
- Deleting a row based on the max value