码迷,mamicode.com
首页 > 其他好文 > 详细

错误代码: 1048 Column 'typeId' cannot be null

时间:2015-10-19 12:48:02      阅读:567      评论:0      收藏:0      [点我收藏+]

标签:mysql   存储过程   

1、错误描述

1 queries executed, 0 success, 1 errors, 0 warnings

查询:CALL analyse_con(‘2015-01-01 00:00:00‘,‘2016-01-01 00:00:00‘)

错误代码: 1048
Column ‘typeId‘ cannot be null

执行耗时   : 0 sec
传送时间   : 0 sec
总耗时      : 0.015 sec

2、错误原因

     typeId字段为int(8),并且不为空,但是插入数据时有null,导致报错


3、解决办法

     拼接SQL语句时,加个判断:

     ifnull(typeId,0) as typeId

版权声明:本文为博主原创文章,未经博主允许不得转载。

错误代码: 1048 Column 'typeId' cannot be null

标签:mysql   存储过程   

原文地址:http://blog.csdn.net/you23hai45/article/details/49247417

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!