2009-06-10 46 views

回答

4
$qry = "select *  
     from school 
     where display='Y' 
     and (announcement != '' AND announcement IS NOT null) 
     order by name, announcement, last_update"; 

这迎合了空白领域以及空字段。

+0

标准SQL的方式是包含NULL的任何声明应该返回null,这就是为什么你必须使用IS NOT NULL或ISNULL() – nickf 2009-06-10 04:15:04

3
announcement IS NOT NULL 

NOT ISNULL(announcement)