獲取前一天時間"getdate() - 1"
獲取上一小時時間"dateadd(hour, -1, getdate())"
order by field1, field2 可以更細緻排序進行輸出
分頁語句
SELECT TOP $row * FROM (SELECT ROW_NUMBER() OVER (ORDER BY [Date] desc) AS RowNumber, * FROM [MyDb].[dbo].[Platform_Statistic]) A WHERE RowNumber > + ($page - 1) * $row ORDER BY RowNumber