type id value 1 a 1 b 2 c 2 d 3 e 3 f 1 g 3 h 2 i
type id value 1 a 2 c 3 e 1 b 2 d 3 f 1 g 2 i 3 h
select * from dataset order by row_number() over (partition by type_id order by value), type_id
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)