Быстрое решение с расширением ROLLUP для GROUP BY :
with
TblPARTS(Part, Make_Buy, Area) as (
select 'AU54', 'M', 'Demo' from dual union all
select 'ZA45', 'M', 'Construct' from dual union all
select 'AD28', 'B', 'Construct' from dual union all
select 'SX73', 'B', 'Construct' from dual union all
select 'MO47', 'M', 'Construct' from dual union all
select 'IN66', 'B', 'Construct' from dual union all
select 'RP42', 'M', 'Demo' from dual union all
select 'HF77', 'B', 'Demo' from dual union all
select 'IE43', 'B', 'Personal' from dual union all
select 'OX11', 'B', 'Personal' from dual union all
select 'ZE45', 'M', 'Demo' from dual union all
select 'JH21', 'M', 'Construct' from dual union all
select 'AM91', 'M', 'Construct' from dual union all
select 'DS50', 'M', 'Demo' from dual union all
select 'LE29', 'M', 'Demo' from dual union all
select 'IP91', 'M', 'Demo' from dual union all
select 'ID42', 'M', 'Demo' from dual union all
select 'RI96', 'M', 'Demo' from dual union all
select 'AO42', 'M', 'Public' from dual union all
select 'OA42', 'B', 'Public' from dual
),
a as (
select
Part, Make_Buy, Area,
GROUPING_ID(Area, Part, Make_Buy) gid
from TblPARTS
group by rollup(Area, (Part, Make_Buy))
having GROUPING_ID(Area, Part, Make_Buy) < 7
)
select
coalesce(Part, Area) Part,
coalesce(Make_Buy, Area) Make_Buy
from a
order by Area, gid desc
Выход:
+------------+-----------+
| PART | MAKE_BUY |
+------------+-----------+
| Construct | Construct |
| AM91 | M |
| IN66 | B |
| JH21 | M |
| SX73 | B |
| ZA45 | M |
| AD28 | B |
| MO47 | M |
| Demo | Demo |
| ZE45 | M |
| RP42 | M |
| RI96 | M |
| LE29 | M |
| IP91 | M |
| ID42 | M |
| HF77 | B |
| AU54 | M |
| DS50 | M |
| Personal | Personal |
| OX11 | B |
| IE43 | B |
| Public | Public |
| OA42 | B |
| AO42 | M |
+------------+-----------+
Протестируйте его онлайн с помощью Rextester .