>>334
スタートがあったら1加算ストップがあったら1減算する累積計算すればいいじゃねえ
select no sum( start + end * -1) as kekka from t as m
left join t as s
on t.no<=m.no
group by no