标签: sql oracle
如何使用Oracle SQL进行以下数据转换:
答案 0 :(得分:1)
您可以轻松地在表示层进行操作,在SQL中,您可以使用row_number():
SQL
row_number()
select (case when row_number() over (partition by colA order by colB) = 1 then colA end) as colA, colB from table t order by colA, colB;