whenever i delete a record and then insert new one, new record is inserted at the deleted index? how can i force new record to be inserted at the end of table?
+5
A:
the short answer is that you can't. The slightly longer answer is that RDBMS technology is based on set-theory and that database tables, like sets, have no distinct order. If you need it to be at the end when you query for that data, I would add an insertion_date field to the table and order by that field in your query.
shsteimer
2010-10-24 11:05:32
or insertion_order autoincrement field
Kel
2010-10-24 11:07:12
@shsteimer, Kel, thanks
aniaz
2010-10-24 11:16:53
Rather than adding 'fields", why can't you SELECT... ORDER BY ?
PerformanceDBA
2010-10-26 02:06:58