mysql 默认值不要为null,最好为空

否则,当你查询的时候,会引起一些异常

比如

select  * from a where b!='new'

假设有一条数据b=null,你是查询不出来的

解决的方法能够改为

select  * from a where ifnull(b,'')!='new'

最好就是建表的时候,默认设置为空,不要null

msyql null 引起的错误的更多相关文章

  1. Cannot retrieve definition for form bean null on action错误

    Cannot retrieve definition for form bean null on action错误 1. 如果jsp页面中要用到<html:form action="& ...

  2. 一个null引发的错误

    写程序时,发生一个unrecognized selector的错误,很显然,这是一个经典错误,运行时找不到可调用的方法. 系统提示的reason是 -[NSNull length] 错误 经过查找,原 ...

  3. No plugin found for prefix 'tomcat' in the current project and in the plugin groups和java.net.BindException: Address already in use: JVM_Bind <null>:8080的错误解决

    错误报告:No plugin found for prefix 'tomcat' in the current project and in the plugin groups [org.apache ...

  4. python 将mysql数据库中的int类型修改为NULL 报1366错误,解决办法

    gt.run_sql()是用pymysql 封装的类 distribution_sort_id type: int目的:将此字段值全部修改为NULL g=2gt.run_sql("updat ...

  5. java.lang.NullPointerException: Attempt to invoke virtual method 'int com.example.xxx.Json.NewsBean.getError_code()' on a null object reference错误解决

    AS在运行的过程中出现了错误: java.lang.NullPointerException: Attempt to invoke virtual method 'int com.example.xx ...

  6. Ibatis insert语句插入null引发的错误

    公司使用的orm框架为ibatis,其中默认的insert语句一直都是这样写的: <insert id="insert" parameterClass="activ ...

  7. SQL must not be null(低级错误)

    提醒一下: 数据库数据源配置出错,也会发生这种低级错误的.

  8. 错误信息:attempt to create saveOrUpdate event with null entity

    错误信息:attempt to create saveOrUpdate event with null entity; 这个错误网上答案比较多,我也不多说了. 我遇到的问题是在前台传过来的参数是nul ...

  9. 数据转换错误,java.lang.NumberFormatException: null

    今天写项目时报了一个数组转换错误的异常,让我找了半天5555 -_- . 一般出现这种错误呢,情况都是parseInt转换所触发的,像下面这行代码 int factorOneInt = Integer ...

随机推荐

  1. XML案例(使用JAXP进行DOM解析)

    1.book.xml <?xml version="1.0" encoding="UTF-8" standalone="no"?> ...

  2. yaml标记语言的简介

    今天遇到yml这个文件,挺懵的.也是百度了一把. 这篇博文不错:http://www.ibm.com/developerworks/cn/xml/x-1103linrr/ 这图画得不错:http:// ...

  3. Spring Boot (3) 热部署devtools

    热部署:当发现程序修改时自动启动应用程序. spring boot为开发者提供了一个名为spring-boot-devtools的模块来使sring boot应用支持热部署,提高开发者的开发效率,无需 ...

  4. 6.10---mybatis的实体---接口---接口映射---主配置文件

  5. 华为 荣耀 等手机解锁BootLoader

    下载工具按提示操作即可 链接:https://pan.baidu.com/s/1qZezd1q 密码:8pad 备用链接:https://pan.baidu.com/s/1nwv0heD

  6. Assembly之instruction之JUMP

    JMP  Jump unconditionally Syntax   JMP  label Operation PC + 2 × offset −> PC Description The 10- ...

  7. Dll中的方法向外返回dynamic类型可能会失败

    如果Dll中有某个类的方法返回dynamic实例,并且dynamic对象实际实例为匿名类类型,则Dll的外部使用者可能最终无法正常使用此dynamic对象.当使用此dynamic对象时,可能会遇到x属 ...

  8. 作业07之《MVC模式》

    MVC(Model View Controller)模型-视图-控制器 MVC与模板概念的理解 MVC本来是存在于Desktop程序中的,M是指数据模型,V是指用户界面,C则是控制器.使用MVC的目的 ...

  9. webpack学习(四)— webpack-dev-server

    webpack提供给我们检查压缩代码的功能之外,还提供了1个服务器的插件,这就是webpack-dev-server,利用这个差价我们可以启动个web服务器并时时更新我们的修改. 下面以1个简单的例子 ...

  10. Js封装html的一些代码

    tableHtml += "<td align=\"left\"><a href=\"javascript:topInfoMenu('&quo ...