開始使用免費開始

計算日期之間的天數

在這個練習中,你要計算訂單日期與出貨日期之間的差異。

本練習屬於課程

SQL Server 中級

檢視課程

練習說明

撰寫一個查詢,回傳 OrderDateShipDate 之間的天數。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

-- Return the difference in OrderDate and ShipDate
SELECT OrderDate, ShipDate, 
       ___(___, OrderDate, ShipDate) AS Duration
FROM Shipments
編輯並執行程式碼