Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/56.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MySQL错误代码1292_Mysql_Mysql Error 1292 - Fatal编程技术网

MySQL错误代码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')

运行以下查询时,我不断收到警告:

警告| 1292 |截断了不正确的双精度值:“已解决日期”

我试图只提取
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