ITeye博客

HQL 与 MySQL中对于控制的处理

forever8tf · 2011-04-09 18:34 · Accumulation · 企业架构 · C · C++ · C# · MySQL · Hibernate · Markdown

在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

 

包邮的哦~亲~

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。