有個需求,把某個日期字段爲空的標記爲N,有值的標記爲Y:
select ecu01, ta_ecu03, nvl2(to_char(ta_ecu03), 'Y','N') as x_status,
nvl(ta_ecu03, to_date('1999-05-07 13:23:44', 'yyyy-mm-dd hh24:mi:ss')) as z_status
from t_table
紅色的列表示轉換成功了
有個需求,把某個日期字段爲空的標記爲N,有值的標記爲Y:
select ecu01, ta_ecu03, nvl2(to_char(ta_ecu03), 'Y','N') as x_status,
nvl(ta_ecu03, to_date('1999-05-07 13:23:44', 'yyyy-mm-dd hh24:mi:ss')) as z_status
from t_table
紅色的列表示轉換成功了