I have a table part_tab
with column serial_no
:
PART_NO SERIAL_NO
A 1
A 2
A 3
A 5
A 7
A 8
A 9
A 10
I would like to aggregate serial_no
values in one row when they are in sequence:
PART_NO SERIAL_NO
A 1-3
A 5
A 7-10
Grouping is by part_no
. So for Part No "A" I would like to select the serial_no
in one column with values "1-3", "5", "7-10". Selected column should range from min to max and in increasing order.