Not sure if I fully understand your question but if you mean that you want to have dynamic amount of columns in PIVOT clause then you need to build the SQL statement dynamically.
In other words depending on the situation if you need to have
PIVOT (MIN(INSGRP) FOR RNO IN (1,2,3,4,5));
or
PIVOT (MIN(INSGRP) FOR RNO IN (1,2,3,4,5,6,7,8,9));
or
PIVOT (MIN(INSGRP) FOR RNO IN (1,2,3));
You need different SQL statements since pivoting does not support dynamic values. See
Ask Tom "Is it possible to use dynamic query in PIVOT in cl..."[
^]
But if you use Pivot XML then you can use a subquery for the columns. For an example have a look at
Dynamic pivot in oracle sql - Stack Overflow[
^]