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

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

原文地址:https://www.cnblogs.com/hzcya1995/p/13314358.html