forever8tf 发表于 2013-2-1 12:17:18

HQL 与 MySQL中对于控制的处理

在MySQL中这样操作哦~
mysql中 新建字段默认值为null,那么要查询此数据的字段时应该怎么操作呢?
错误的写法:
select * from $table where 字段=null 或  select * from $table where length(字段)=0
正确的写法是:
select * from $table where 字段 is null
 
在Hibernate中这样操作哦~
form   user   as   c   where   c.name   is   null
 
包邮的哦~亲~
页: [1]
查看完整版本: HQL 与 MySQL中对于控制的处理