---
title: "HQL 与 MySQL中对于控制的处理"
author: "forever8tf"
date: "2011-04-09T18:34:55Z"
tags: ["C", "C#", "C++", "Hibernate", "MySQL"]
categories: ["企业架构"]
slug: "hql-mysql"
draft: false
lastmod: "2011-04-09T18:34:55Z"
id: 994818
url: "https://forever8tf.iteye.com/blog/994818"
---

在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

 

包邮的哦～亲～