I have the following problem. On my server I have to maintain data in particular order (to by specific order of insertion). And it has to be stored in a file. I’m currently using SQLite to do this, but is it safe to assume that SQL db will keep the order of insertion, or should I use something else (in this case please give me a hint what to do).
Share
Rows in a table are not stored in any particular order. You can only guarantee order with an
order byclause.To order rows by insertion, you’d typically use an autoincrement column. That assigns a higher values to rows that are inserted later. You can then
order by autoinc_colto retrieve rows in the order in which they were inserted.