By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
| section | section_name | section_id | min(student_rollno) | max(student_rollno) |
|---|---|---|---|---|
| A | DIV A | 01 | 547 | 552 |
| A | DIV A | 01 | 567 | 568 |
| A | DIV A | 01 | 593 | 598 |
| section | section_name | section_id | group_concat(min_sr, '-', max_sr order by min_sr separator ', ') |
|---|---|---|---|
| A | DIV A | 01 | 547-552, 567-568, 593-598 |
| section | section_name | section_id | group_concat(min_sr, '-', max_sr order by min_sr separator ', ') |
|---|---|---|---|
| A | DIV A | 01 | 547-552, 567-568, 593-598 |