If I have a data set with a composite key of an order number and a timestamp, can I iterate through the timestamps to search for data values at the specific time? For example, I would want to iterate through the specific order number until I find the first timestamp that contains a BOL and then insert that date record into a new table. In general I am trying to find days between events in the "life-cycle" of an order.
Example Data:
| Order | Timestamp | BOL |
| ------| ---------- |---------|
| 12345 | 05.25.21.05:00 |null |
| 12345 | 05.26.21.05:00 |512345 |
| 67890 | 05.25.21.05:00 |null |
| 67890 | 05.26.21.05:00 |556725 |
Pseudocode:
SET @i=0;
while(i<size(order.timestamps())){
if(order.timestamp[i].BOL is NULL)
i++;
else
order.bolDate = order.timestamp(i);
exit;
}
Thank you for any assistance even if it's nothing more than a link!