T-SQL OR
关键字OR,可应用在条件子句WHERE中,查询两个或以上不同条件。
演示,数据来源,参考http://www.cnblogs.com/insus/articles/1968148.html,查询出日期为'2011-01-23' 或者为'2011-01-26'的记录:
View Code
SELECT [RId],[DT],[Hits] FROM [dbo].[RecordHits]
WHERE [DT] = '2011-01-23' OR [DT] = '2011-01-26'
WHERE [DT] = '2011-01-23' OR [DT] = '2011-01-26'
执行结果: