在select语句中使用OR时的正确用法是什么?
我有3列我想用来过滤搜索结果:
Employee
,Department
,Date_Hired
查询是一个简单的选择
SELECT Col1, Col2, Col3,.... FROM table Where
Employee = "" OR
Department = "" OR
Date_Hired BETWEEN "" AND ""
我尝试做的是用户是否只想使用过滤结果 3列中的任何一列,例如,如果它像:
WHERE Employee = "Mickey"
OR Department = ""
OR Date_Hired BETWEEN "" AND ""
或者,如果用户还想搜索所雇用的日期
WHERE Employee = "Mickey"
OR Department = ""
OR Date_Hired BETWEEN "2014-01-01" AND "2014-01-31"
使用它的正确方法是什么?