Sample data:
ORDER SEQ IN OUT
310 1 Jan-20 Jan-22
310 2 Jan-22 Jan-23
207 1 Jan-23 Jan-26
207 2 Jan-26 Jan-27
207 3 Jan-27 Jan-29
I need to create a new table that makes ORDER
a primary key and assigns each ORDER
entry a new IN
and OUT
value by retrieving the new IN
value from the lowest SEQ
of that ORDER
and the new OUT
value from the greatest SEQ
of that ORDER
.
For example:
ORDER IN OUT
310 Jan-20 Jan-23
207 Jan-23 Jan-29
Any help would be appreciated