2009-06-10 62 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)