如果可能的话,我想在一份声明中做到这一点。
我原来的查询是这样的:
SELECT CAST(Date as DATE) as DayDate, SUM(Books) as LostBooks
FROM RestartBooksView
WHERE Name = 'AUHT167' and Date > (getdate() - 105)
GROUP BY CAST(Date as DATE)
ORDER BY CAST(Date as DATE) ASC
这个查询的问题是我希望总和反映在上午 7 点到 7 点,而不是当前的 12 点到 12 点。如何修改我的查询以反映此更改?