नीचे दिया गया कोड शीर्षक में प्रश्न को स्पष्ट करता है। इसे काम करने के लिए 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?