下面的代码澄清了标题中的问题。什么可以放在WHERE使其工作?
CREATE TABLE #PickedTimes
(StartTime smalldatetime,
EndTime smalldatetime)
INSERT INTO #PickedTimes
VALUES ('2019-01-25 16:05', '2019-01-25 17:05'),
('2019-01-25 19:05', '2019-01-25 20:05')
--Each row is a time range. There would be more in the real situation, and it is desirable to define them this way.
SELECT * FROM #PickedTimes
-- No questions up to here.
SELECT TransactionID, Timestamp
FROM Transactions
WHERE Timestamp -- SOMETHING WITH #PickedTimes. How to make it pick any of the time ranges in #PickedTimes?