I needed to select the last records in a table. I could do a MySQL query with no limit on records, but that could be inefficient. Instead you could and this to the end of your MySQL query:
order by id desc limit x
SELECT * FROM articles order by id desc limit 5
This will return the last five records in the table.
Shows Rails data types, also maps to SQL datatypes