db.insert not respecting order of rows
Having an issue where I'm inserting data into the db via a for loop. However the data gets inserted in a different order. Any ideas?
Produces:
2 Replies
Not sure I understand the question/problem correctly, but in the
after ins
part you are querying a database without specifying the order by
, so you are probably getting them sorted how the database seems fit.Adding onto what Jetrak said, if not
order by
clause is specified, it will likely sort by the column that has the primary key. For serial IDs, this would still present the data in order, but with UUIDs (like in this case), the sorting will look random