Hello all.
I have a table defined in sql server as follows:
ROW_ID (identity)
DEPTH_FROM Number (8,3)
DEPTH_TO Number (8,3)
COLOUR Char(10)
With typical data like:
ROW_ID DEPTH_FROM DEPTH_TO COLOUR
---------------------------------------------------------------
1 0 5
BLUE
2 5 8
BLUE
3 8 10
RED
4 10 12
GREEN
5 12 16
GREEN
I want to create a view that will 'compress/roll up' the data so
it appears like:
DEPTH_FROM DEPTH_TO COLOUR
---------------------------------------------------------
0 8 BLUE
8 10 RED
10 16 GREEN
I have been working on this for several days, with no luck,
any help would be appreciated. BTW: there are no overlaps
allowed in the depth_from, depth_to values.
Thanks in advance.
I have a table defined in sql server as follows:
ROW_ID (identity)
DEPTH_FROM Number (8,3)
DEPTH_TO Number (8,3)
COLOUR Char(10)
With typical data like:
ROW_ID DEPTH_FROM DEPTH_TO COLOUR
---------------------------------------------------------------
1 0 5
BLUE
2 5 8
BLUE
3 8 10
RED
4 10 12
GREEN
5 12 16
GREEN
I want to create a view that will 'compress/roll up' the data so
it appears like:
DEPTH_FROM DEPTH_TO COLOUR
---------------------------------------------------------
0 8 BLUE
8 10 RED
10 16 GREEN
I have been working on this for several days, with no luck,
any help would be appreciated. BTW: there are no overlaps
allowed in the depth_from, depth_to values.
Thanks in advance.
Comment