我在不同的列中有年、月、日,我想將它們全部合并到雪花中的一列中
uj5u.com熱心網友回復:
您應該使用DATE_FROM_PARTS函式:
select date_from_parts(1977, 8, 7);
參考:DATE_FROM_PARTS
uj5u.com熱心網友回復:
創建一個字串運算式,然后使用 To_Date 函式。例如:
set (day, month, year) = ('26', '10', '2021');
set strDate = concat(year, '-', month, '-', day);
select to_date(strDate)
uj5u.com熱心網友回復:
select year||'-'||month||'-'||day from table
其中年、月和日是相應資料的列名。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/337259.html
