1. 程式人生 > >SQL根據日期查詢年、月、星期等

SQL根據日期查詢年、月、星期等

DateName(year,GetDate()) as '年',
DateName(month,GetDate()) as '月',
DateName(day,GetDate()) as '日',
DateName(dw,GetDate()) as '星期',
DateName(week,GetDate()) as '週數',
DateName(hour,GetDate()) as '時',
DateName(minute,GetDate()) as '分',
DateName(second,GetDate()) as '秒'