locked
Data is inserted in order in the table RRS feed

  • Question

  • Hello All:

    Please take a look at the attached snap shot of a database record. I'm collecting the data for every one minute and storing it the table. Sometimes, when I close my data collection application or restart, or if there is an interruption and resume my data collection again, the data will not be inserted in a proper order.

    If you notice, the data collected at the interval  11:06 is inserted between 10:52 and 10:54 where should have been inserted after 11:01. Could anyone please let me know what is the problem?

    Wednesday, May 30, 2018 1:22 PM

Answers

  • Rows in a table, like a resultset, have no inherent and reliable order. If the query you use to generate the above image has no order by clause, then the order of rows is undefined. Add an order by clause if you need to see rows in a particular order. 
    Wednesday, May 30, 2018 1:37 PM

All replies

  • Rows in a table, like a resultset, have no inherent and reliable order. If the query you use to generate the above image has no order by clause, then the order of rows is undefined. Add an order by clause if you need to see rows in a particular order. 
    Wednesday, May 30, 2018 1:37 PM
  • Thank you!
    Wednesday, May 30, 2018 2:27 PM