我的代码是这样的:关于避免这么多或语句的任何想法?(SQL服务器)
SELECT ID, COUNT(*) AS UNIQUE_USERS
FROM
(SELECT Address, ID
FROM Table
WHERE
(DateSent between '2012-12-21 00:00:00' and '2012-12-21 23:59:59' or
DateSent between '2012-12-27 00:00:00' and '2012-12-27 23:59:59' or
DateSent between '2013-01-03 00:00:00' and '2013-01-03 23:59:59' or
DateSent between '2013-02-27 00:00:00' and '2013-02-27 23:59:59' or
DateSent between '2013-03-01 00:00:00' and '2013-03-01 23:59:59' or
DateSent between '2013-03-07 00:00:00' and '2013-03-08 23:59:59' or
DateSent between '2013-03-22 00:00:00' and '2013-03-22 23:59:59'
)AND
GROUP BY Address, ID
) AS USERS
GROUP BY USERS.ID
提前致谢
尼奥尼奥斯