Yes, there’s an auto_increment in there
If you want the last of all the rows in the table, then this is finally the time where MAX(id)
is the right answer! Kind of:
SELECT fields FROM table ORDER BY id DESC LIMIT 1;
More Related Contents:
- Why do I get an error from this sub query script?
- sql query to modify the selected value from database [closed]
- how to get similar search results in MySQL?
- How can I SELECT rows with MAX(Column value), PARTITION by another column in MYSQL?
- Can I concatenate multiple MySQL rows into one field?
- Disable ONLY_FULL_GROUP_BY
- SELECT list is not in GROUP BY clause and contains nonaggregated column …. incompatible with sql_mode=only_full_group_by
- How to do the Recursive SELECT query in MySQL?
- MySQL, update multiple tables with one query
- MySQL foreign key constraints, cascade delete
- How do I see all foreign keys to a table or column?
- Mysql or/and precedence?
- MySQL “Group By” and “Order By”
- CHECK constraint in MySQL is not working
- MySQL Query to select data from last week?
- ERROR 2003 (HY000): Can’t connect to MySQL server on ‘127.0.0.1’ (111)
- Migrate from Oracle to MySQL
- Which is more efficient: Multiple MySQL tables or one large table?
- Are there disadvantages to using a generic varchar(255) for all text-based fields?
- How to skip columns in CSV file when importing into MySQL table using LOAD DATA INFILE?
- Error Code 1292 – Truncated incorrect DOUBLE value – Mysql
- MySQL InnoDB foreign key between different databases
- Images in MySQL
- Replace Into Query Syntax
- Loading utf-8 encoded text into MySQL table
- adding RMySQL package to R fails (on Windows)?
- Ruby gem mysql2 install failing [duplicate]
- What’s the best way to migrate a Django DB from SQLite to MySQL?
- MySQL “IN” queries terribly slow with subquery but fast with explicit values
- How to create and insert a JSON object using MySQL queries?