Maison > Article > base de données > display month as a calendar using sql
---sql server 2005 顯示一個月的數據,如果沒有空的也要顯示出來declare @T table([geovinddate] Datetime,[workcontent] nvarchar(8),[worker] nvarchar(50))Insert @Tselect '2012-8-11',N'遲到','geovindu' union allselect '2012-8-12',N'早退','geovin
---sql server 2005 顯示一個月的數據,美国空间,如果沒有空的也要顯示出來 declare @T table([geovinddate] Datetime,[workcontent] nvarchar(8),[worker] nvarchar(50)) Insert @T select '2012-8-11',N'遲到','geovindu' union all select '2012-8-12',N'早退','geovin' ;with Date as (select cast('2012-08-01' as datetime) Date union all select Date+1 from Date where Date+1