邏輯運算元:and(且)、or(或)、not(非、反值)
範例一:列出編號和姓名欄位,符合三科都不及格的資料
指令:select no,name from exam where cht<60 and eng<60
and math<60;

範例二:列出符合國文科高於90分或低於40分的資料
指令:select * from exam where cht>90 or cht<40;

範例三:列出符合英文科及格者的資料
指令:select * from exam where not(eng<60);

|