There is no such thing as what you are thinking. The database is a mechanism for storing and querying data. You do not establish how it will be stored, this is his problem to do this, the data is only there, no matter how. You insert what you need and it's over, it does not matter as it was inserted.
When you go to see you have to say how you want the results to come back. Since the secret is in SELECT
, there you will tell the way information is brought to you.
The question does not give details to help better, but probably would look something like this:
SELECT * FROM tabela ORDER BY id DESC;
See running on SQL Fiddle . Also I've placed GitHub for future reference .
If you have a column named id
that is auto incremented. That's usually how you do it. If you do not have a column with a value that is guaranteed in ascending order you can not do what you want in MySQL, that is probably an error. Creating an index to better handle this order can be instrumental in maintaining good performance on many lines.