Mysql报错---Data truncation: Truncated incorrect DOUBLE value: 'C'
2018-01-10 15:06
399 查看
原来的sql
报错原因:CASE fee_type WHEN 3 THEN "2" WHEN "C" THEN 3 ELSE 4 END中3是数值型,C是字符型,无法相互转换,所以报错
改为
INSERT INTO tbl_receivable_list ( id, POLICYID, PRODUCTID, FEETYPE, INSURERID, PREMIUM, COMMIRATE, COMMIAMOUNT, CHARGEBILLID, MARK, REMARK, applicant, applicantname, insured, insuredname, endorseno, policyno, agentid, orgid, createdate, applicanttime, afterTaxPremium, pay_time ) SELECT REPLACE (UUID(), "-", ""), source.policyid, source.productid, source.fee_type, source.insurerid, source.premium, source.commirate, source.commiamount, source.chargebillid, CASE fee_type WHEN 3 THEN "2" WHEN "C" THEN 3 ELSE 4 END, "新保单", source.applicant, source.applicantname, source.insured, source.insuredname, source.endorseno, source.policyno, source.fee_target_id, source.orgid, NOW(), source.operatedate, source.after_tax_premium, source.pay_time FROM ( SELECT top.orgid, top.operatedate, top.applicantname, top.applicant, top.insured, top.insuredname, top.endorseno, top.policyno, top.discount, tcl.chargebillid, tcl.policyid, tcl.premium, tcl.after_tax_premium, tcl.insurerid, tcl.productid, tcl.fee_target_id, tcl.commirate, tcl.commiamount, tcl.fee_type, tcl.pay_time FROM tbl_oper_policymana top INNER JOIN tbl_chargebill tc ON top.id = tc.policyid LEFT JOIN tbl_chargebill_list tcl ON tc.id = tcl.chargebillid WHERE top.isaudit = '12203' AND top.chargebillid IN ('d696d806e3b74fc18fe163c6e4dd95fc') ) source
报错原因:CASE fee_type WHEN 3 THEN "2" WHEN "C" THEN 3 ELSE 4 END中3是数值型,C是字符型,无法相互转换,所以报错
改为
INSERT INTO tbl_receivable_list ( id, POLICYID, PRODUCTID, FEETYPE, INSURERID, PREMIUM, COMMIRATE, COMMIAMOUNT, CHARGEBILLID, MARK, REMARK, applicant, applicantname, insured, insuredname, endorseno, policyno, agentid, orgid, createdate, applicanttime, afterTaxPremium, pay_time ) SELECT REPLACE (UUID(), "-", ""), source.policyid, source.productid, source.fee_type, source.insurerid, source.premium, source.commirate, source.commiamount, source.chargebillid, CASE fee_type WHEN "3" THEN "2" WHEN "C" THEN 3 ELSE 4 END, "新保单", source.applicant, source.applicantname, source.insured, source.insuredname, source.endorseno, source.policyno, source.fee_target_id, source.orgid, NOW(), source.operatedate, source.after_tax_premium, source.pay_time FROM ( SELECT top.orgid, top.operatedate, top.applicantname, top.applicant, top.insured, top.insuredname, top.endorseno, top.policyno, top.discount, tcl.chargebillid, tcl.policyid, tcl.premium, tcl.after_tax_premium, tcl.insurerid, tcl.productid, tcl.fee_target_id, tcl.commirate, tcl.commiamount, tcl.fee_type, tcl.pay_time FROM tbl_oper_policymana top INNER JOIN tbl_chargebill tc ON top.id = tc.policyid LEFT JOIN tbl_chargebill_list tcl ON tc.id = tcl.chargebillid WHERE top.isaudit = '12203' AND top.chargebillid IN ('d696d806e3b74fc18fe163c6e4dd95fc') ) source
相关文章推荐
- Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'L
- mysql使用update更新数据遇到的错误:Data truncation: Truncated incorrect DOUBLE value:Mysql Update
- Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'L
- Data truncation: Truncated incorrect DOUBLE value:Mysql Update时
- MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value
- com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value
- Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value: 'L
- com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE value
- mysql执行update语句时报错:Data truncation: Truncated incorrect DOUBLE value: 'null'
- 【转】Data truncation: Truncated incorrect DOUBLE value:Mysql Update时
- Mysql:INSERT INTO SELECT 带来的Truncated incorrect DOUBLE value: '22BFFADCDE5D66DBE05301F01CACE524'问题
- 执行update语句mysql5.6报错ERROR 1292 (22007): Truncated incorrect DOUBLE value: '糖糖的坤大叔'
- 执行update语句mysql5.6报错ERROR 1292 (22007): Truncated incorrect DOUBLE value: '糖糖的坤大叔'
- Data truncation: Truncated incorrect DOUBLE value 解决方案
- mysql 出现 Truncated incorrect DOUBLE value:
- com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE
- nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Truncated incorrect DOUBLE
- laravel+Mysql 中DB原生SQL操作报1292 Truncated incorrect DOUBLE value问题解决
- mysql Truncated incorrect DOUBLE value
- Mysql [Err] 1292 - Truncated incorrect DOUBLE value: 'a'