<%@LANGUAGE="VBSCRIPT" CODEPAGE="950"%> 拓米數位MySQL教學文件
文件標題:[E008]where敘述使用is null及is not null敘述

內容說明:

1、先更新記錄將座號no=3的英文分數eng設為null
2、where敘述使用is null敘述
3、where敘述使用is not null敘述

教學內容:

1、先更新記錄將座號no=3的英文分數eng設為null(若缺考則沒分數)

說明:「null」:代表"空",不是指0,是指沒資料,用echo顯示也沒資料,就是空

指令:update exam set eng=null where no=3;

2、where敘述使用is null敘述

用於篩選出某欄位的記錄中有null的資料

指令:where 欄位名稱 is null

範例:列出符合英文科缺考的資料

指令:select * from exam where eng is null;

3、where敘述使用is not null敘述

用於篩選出某欄位的記錄中不是null的資料

指令:where 欄位名稱 is not null

範例:不要將英文科缺考的資料列出

指令:select * from exam where eng is not null;

   
   最後修改日期: 2003年10月22日