<%@LANGUAGE="VBSCRIPT" CODEPAGE="950"%> 拓米數位MySQL教學文件
文件標題:[E007]where敘述使用between...and...敘述及in敘述

內容說明:

1、where敘述使用between...and...敘述
2、where敘述使用in敘述

教學內容:

1、where敘述使用between...and...敘述

用於篩選出某一範圍的資料

範例:列出符合國文科20分至80分的資料

指令:select * from exam where cht between 20 and 80;

2、where敘述使用in敘述

用於篩選出相同值的資料

指令:where 欄位名稱 in (值一,值二,值三,...)

(1)、範例一:列出符合姓名欄位中為dog及cat的資料

指令:select * from exam where name in ('dog','cat');

(2)、範例二:列出符合數學分數欄位中為55及32分的資料

指令:select * from exam where math in (55,32);

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