Thinkphp中查询复杂sql查询表达式,如何表达MYSQL中的某字段不为空is not null?先上两种实现方式的实例:$querys["house_type_image"] = array('NEQ','NULL'); //判断字段不为空//$querys["house_type_image"] = array('exp','is not null');//其中的exp表示MYSQL的表达式查询,支持各种MYSQL语句的添加-----------------…
为什么要把字段设置成not null 呢? 1.空值是不占用空间的 2.mysql中的NULL其实是占用空间的,下面是来自于MYSQL官方的解释 “NULL columns require additional space in the row to record whether their values are NULL. For MyISAM tables, each NULL column takes one bit extra, rounded up to the nearest byt…