SQLite Forum

Is the order conserved in a table from a VALUES clause?
Login
A SQL (not just SQLite) database is a *set* of rows.  Not an ordered set.  The rows of a table are in no particular order.  Theoretically you can execute

<code>   SELECT * FROM MyTable</code>

twice and get the same answers in a different order each time.

Row numbers normally don't matter: you don't bother assigning them and you would never care enough to retrieve them.  If, on the other hand, you want specific row numbers for each of the values you insert, you can assign your row numbers to a column.