Nacef, Simply add a SERIAL column to your table. When you add a new row, a new value will be stored in this column if you do not specify the column name in the insert query. In your select query, always order by this column. When doing an update , do not update this column. When re-ordering, update this column to indicate order. So if you want to move a row up, issue two update queries, updating this column. Make sure you have some primary key in this table to uniquely identify these row. Never rely on the internal implementation of a database to keep the data in the order you insert/update. Padam Nacef LABIDI wrote: You are right about the fact that the rows don't keep the order they where created with at the start. I have verfied this. -- PGP Id 9EED2E09 |
- [SQL] After updating dataset the record goes to ... Nacef LABIDI
- Re: [SQL] After updating dataset the record... Nacef LABIDI
- Re: [SQL] After updating dataset the re... hubert depesz lubaczewski
- Re: [SQL] After updating dataset th... Nacef LABIDI
- Re: [SQL] After updating datase... Pavan Deolasee
- Re: [SQL] After updating datase... hubert depesz lubaczewski
- Re: [SQL] After updating datase... Padam J Singh
- Re: [SQL] After updating dataset the re... Craig Ringer
- Re: [SQL] After updating dataset th... Bart Degryse
- Re: [SQL] After updating datase... Nacef LABIDI
- Re: [SQL] After updating d... Scott Marlowe
- Re: [SQL] After updating dataset the record... Thomas Kellerer
- Re: [SQL] After updating dataset the record... Gurjeet Singh