【发布时间】:2022-11-23 23:39:12
【问题描述】:
我有这张桌子
Date_data (date format)
03-06-2022
08-08-2021
[NULL]
[NULL]
14-04-2022
25-01-2015
[NULL]
[NULL]
30-01-2019
此表有日期和空值。此表在存储过程中调用,但“日期”格式因空值而丢失
Date_data (text format)
03/06/2022
08/08/2021
[NULL]
[NULL]
14/04/2022
25/01/2015
[NULL]
[NULL]
30/01/2019
我尝试了什么(但它仍然以文本格式提供):
cast(Date_data as date)
date_format (Date_data,%d%m%Y), I also tried date_format (Date_data,%Y%m%d)
date(Date_data)
str_to_date(Date_data,%d%m%Y)
if(Date_date is null, '', Date_data)
if(Date_date is null, '-', Date_data)
如何在不丢失格式的情况下调用表格?
【问题讨论】:
标签: mysql