如何获取sql数据中时间的月份、年份(类型date)
可用自带函数month来实现。 如: 创建表及插入数据:create table test(id int,begindate datetime)insert into test values (1,'2015-01-01')insert into test values (2,'2015-02-01')执行sql语句,获取月份:select id,MONTH(begindate) as m
原创
2017-08-31 23:49:40 ·
112409 阅读 ·
6 评论