Reputation: 40140
I'm using MySql and am pretty new to it.
I have a table which stores 5 measurements every X seconds (configurable, but always the same fore each test run)
I am taking 4 measurements over serial port, but the other must be measured manually.
I write a new row, with timestamp, every time I measure at the 4 serial ports (every X seconds), which means that value of the manual measurement is written as its value last time it was measured.
Now, suppose the user takes a sample at presciently 10:000:00 and goes to manually analayze and comes back 2 minutes later to enter the value into my program... I have already written the previous value for the period 10:00:: to 10:02:00 and I have to go back and update them to the value just entered.
Is there one simple statement that will do that? just lock the table or dataset, find all rows between two timestamps and update one column to the new value, then unlock?
Upvotes: 1
Views: 53
Reputation: 6683
UPDATE Measurements
SET ManualMeasurement = 'someNumber'
WHERE TimeTaken Between 'startTime' AND 'endTime'
is that the sort of thing you are looking for?
Upvotes: 3