Поскольку вы отметили это для SQL Developer (который в этом контексте можно назвать слоем приложения / представления), вы можете использовать break ... nodup
:
clear breaks
break on order_no nodup on item nodup
with your_table (order_no, item, code) as (
select 1234, 999999, 777 from dual
union all select 1234, 999999, 111 from dual
union all select 1234, 999999, 777 from dual
union all select 1234, 999999, 111 from dual
)
select * from your_table;
ORDER_NO ITEM CODE
---------- ---------- ----------
1234 999999 777
111
777
111
С несколькимизаказы и предметы:
with your_table (order_no, item, code) as (
select 1234, 999999, 777 from dual
union all select 1234, 999999, 111 from dual
union all select 1234, 999999, 777 from dual
union all select 1234, 999999, 111 from dual
union all select 1235, 999999, 111 from dual
union all select 1236, 999999, 111 from dual
union all select 1236, 999998, 111 from dual
union all select 1236, 999998, 111 from dual
)
select * from your_table;
ORDER_NO ITEM CODE
---------- ---------- ----------
1234 999999 777
111
777
111
1235 999999 111
1236 999999 111
1236 999998 111
111