如何删除不在特定时间段内的行?

How delete rows that are not in a specific time period?

有没有办法删除 'datetime' 不在08:30:00.000 到 14:59

内的所有行

以下是我的一些行 table:

open    high    low close   volume  datetime
277.14  277.51  276.71  276.8799    968908  2020-04-13 08:30:00.000
245.3   246.06  245.2   246.01  1094537 2020-04-01 14:48:00.000
285.12  285.27  284.81  285.22  534427  2020-04-27 08:30:00.000
246.08  246.08  245.27  245.46  1333257 2020-04-01 14:50:00.000
291.71  291.73  291.08  291.28  1439183 2020-04-30 08:30:00.000
245.89  246.63  245.64  246.25  960411  2020-04-01 14:52:00.000
285.18  285.4   285 285.36  188531  2020-04-27 08:32:00.000
285.79  285.79  285.65  285.68  6251    2020-05-14 18:59:00.000
246.25  246.56  246.12  246.515 956339  2020-04-01 14:54:00.000

我只需要08:30<='datetime'<15:00的行,不管在哪个day.Currently我发现有很多行超出了时间范围08:30-14:59,所以我想找到一种快速删除所有超出此范围的行的方法。

尝试根据时间范围删除:

DELETE
FROM yourTable
WHERE CONVERT(time, datetime) < '08:30:00' OR CONVERT(time, datetime) >= '15:00:00';