A At times, I need to manage a long list of options; therefore, the logical approach is to organize them into groups rather than having everything in a single list. However, this approach introduces several challenges. Previously I just added another LOV item just with groups, but with multiple items you will quickly clutter your UI. The groups are sorted alphabetically. So if you want a different order, you have to use this neat trick, which add spaces at the start of your group name, and hence it gets sorted as you wish: SELECT NVL(g.group_name, INITCAP(g.group_code)) AS group_name, -- LPAD(' ', ROW_NUMBER() OVER ( -- reverse r# for proper grouping sets sorting hack ORDER BY g.order# DESC NULLS FIRST, g.group_code DESC ), ' ') || NVL(g.group_name, INITCAP(g.group_code)) AS group_name__, -- groups sorted, use in LOV as group -- ROW_NUMBER() OVER ( ORDER BY ...
Mainly APEX, sometimes SQL, PL/SQL, clean code and certifications