English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I found out that if I add new records, the newest one isn't necessarily saved at the end of the database. Sometimes it's inserted right in the middle. I need to find out the most recent entry but I don't have a field that serves as a counter. What do I do?

2006-12-19 23:58:55 · 3 answers · asked by mfgabenz 2 in Computers & Internet Programming & Design

3 answers

consider adding a date column to such tables and at the time of insertion, select the current dat/time
This will let you sort the records correctly on time

2006-12-20 00:23:24 · answer #1 · answered by Neil 5 · 0 0

If you're not prepared to change your database structure to contain an increasing key or a timestamp field, then there's no reliable solution that'll work in the longer term.

2006-12-20 08:05:36 · answer #2 · answered by Anonymous · 2 0

Modify your table-schema to include a counter field. This should either be an incrementing numeric identity field, or a timestamp field.

2006-12-22 14:26:59 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers