MySQL错误代码1292
运行以下查询时,我不断收到警告: 警告| 1292 |截断了不正确的双精度值:“已解决日期” 我试图只提取MySQL错误代码1292,mysql,mysql-error-1292,Mysql,Mysql Error 1292,运行以下查询时,我不断收到警告: 警告| 1292 |截断了不正确的双精度值:“已解决日期” 我试图只提取str\u customvalue中的日期字符串。这就是为什么我做了一个日期(DATE(str_customvalue))不是空的 Select case str_category when ('Resolved Date' and (status = 'Closed')
str\u customvalue
中的日期字符串。这就是为什么我做了一个日期(DATE(str_customvalue))不是空的
Select
case str_category
when
('Resolved Date'
and (status = 'Closed')
and (DATE(str_customvalue) is not null)
)
then
cast(str_customvalue as datetime)
else cast(str_diff_date` as datetime)
end AS last_diff_date
From table
有没有办法删除此警告?查询工作正常,但为了让脚本通过QA,我需要删除此警告。我使用IF()语句解决了此问题:
Select
IF ( str_category = 'Resolved Date' and
and (status = 'Closed')
and (DATE(str_customvalue) is not null,
cast(str_customvalue as datetime),
cast(str_diff_date` as datetime))
AS last_diff_date
From table