時間:2024-02-13 10:23作者:下載吧人氣:18
數據表中有一列數據,如圖所示:
現在需要將該列數據分成三列。
SQL 代碼如下所示:
第一種
select
max(case when F1%3=1 then F1 else 0 end) a,
max(case when F1%3=2 then F1 else 0 end) b,
max(case when F1%3=0 then F1 else 0 end) c
from HLR151
group by (F1-1)/3
網友評論