select case when aaa.gj_rownum=1 then aaa.gj else null end gj ,
case when aaa.cs_rownum=1 then aaa.cs else null end cs
,case when aaa.qy_rownum=1 then aaa.qy else null end qy
,case when aaa.item_rownum=1 then aaa.item else null end item
,aaa.qty
from (
select aa.*, row_number()over(partition by aa.gj order by rownum ) gj_rownum
,row_number()over(partition by aa.cs order by rownum ) cs_rownum
,row_number()over(partition by aa.qy order by rownum ) qy_rownum
,row_number()over(partition by aa.item order by rownum ) item_rownum
from ( select * from cux_test a order by gj, cs,qy,item ) aa