У меня есть таблица вроде этого:
ID Seq Amt
1 1 500
1 2 500
1 3 500
1 5 500
2 10 600
2 11 600
3 1 700
3 3 700
Я хочу сгруппировать непрерывные порядковые номера в одну строку следующим образом:
ID Start End TotalAmt
1 1 3 1500
1 5 5 500
2 10 11 1200
3 1 1 700
3 3 3 700
Пожалуйста, помогите достичь этого результата.