時間:2024-02-13 10:23作者:下載吧人氣:20
數(shù)據(jù)表中有一列數(shù)據(jù),如圖所示:
現(xiàn)在需要將該列數(shù)據(jù)分成三列。
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
網(wǎng)友評論