I am having issues writing a query and was hoping someone might be able to offer some advice. The data is related to the geology of bore holes. The From and To fields are the depth down the bore hole.
table1:
holeID --- | --- From ---|---To---|---FMN---|---Rocktype ---|
MW1------|-------0-------|---10---|-----X-----|--------13-------|
MW1------|-------10-----|---20---|-----X-----|--------122------|
MW1------|-------20-----|---30---|-----Y-----|--------177------|
MW1------|-------30-----|---40---|-----Y-----|--------146------|
MW1------|-------40-----|---50---|-----Z-----|--------145-------|
MW1------|-------50-----|---60---|-----X-----|--------1----------|
MW1------|-------60-----|---70---|-----X-----|--------123-------|
MW1------|-------70-----|---80---|-----X-----|--------121-------|
MW1------|-------80-----|---90---|-----Z-----|--------120-------|
Which I would like to condense to:
holeID --- | --- From ---|---To---|---FMN---|
MW1------|-------0-------|---20---|-----X-----|
MW1------|-------20-----|---40---|-----Y-----|
MW1------|-------40-----|---50---|-----Z-----|
MW1------|-------50-----|---80---|-----X-----|
MW1------|-------80-----|---90---|-----Z-----|
SQL Fiddle