mysql的yearweek 和 weekofyear函数
来源:互联网 发布:php电子商务网站源码 编辑:程序博客网 时间:2024/06/06 04:15
1.MySQL 的 YEARWEEK 是获取年份和周数的一个函数,函数形式为 YEARWEEK(
date
[,mode
])
例如 2010-3-14 ,礼拜天
SELECT YEARWEEK('2010-3-14') 返回 11
SELECT YEARWEEK('2010-3-14',1) 返回 10
其中第二个参数是 mode ,具体指的意思如下:
ModeFirst day of weekRangeWeek 1 is the first week …0Sunday0-53with a Sunday in this year1Monday0-53with more than 3 days this year2Sunday1-53with a Sunday in this year3Monday1-53with more than 3 days this year4Sunday0-53with more than 3 days this year5Monday0-53with a Monday in this year6Sunday1-53with more than 3 days this year7Monday1-53with a Monday in this year2. weekofyear函数是计算出当前日期所在周数,和YEARWEEK('日期',1)的周数一致,但YEARWEEK('日期',1)在小于10的时候,不带0
select WEEKOFYEAR('2016-2-2'); =5
1 0
- mysql的yearweek 和 weekofyear函数
- MySQL 的 YEARWEEK函数用法
- MySQL的YEARWEEK函数以及查询本周数据
- MySQL的YEARWEEK函数以及查询本周数据
- mysql的yearweek()函数转换与逆转换。
- Hive 日期函数 weekofyear
- hive weekofyear 怪异的姿势
- DB2或MySql的week_iso或weekOfYear()与java的Calendar.WEEK_OF_YEAR保持一致
- 【MySQL函数】MYSQL IFNULL和IF函数的使用
- mysql的日期和时间函数
- mysql的日期和时间函数
- mysql的日期和时间函数
- mysql 的日期和时间函数
- [转]mysql的日期和时间函数
- mysql的日期和时间函数
- mysql的日期和时间函数
- Mysql的日期和时间函数
- mysql 和oracle的函数比较
- 54. Spiral Matrix
- Retrofit的使用封装
- [Coci2015]Stanovi解题报告
- Spark MLlib 1.6 -- 特征抽取和变换
- HDU 1002 A+B problemII
- mysql的yearweek 和 weekofyear函数
- 设置服务器开机启动不要填写密码 control userpasswords2
- C++中如何修改const变量(非常重要)
- 304. Range Sum Query 2D - Immutable
- 安卓使用webView中的JavaScript代码
- MFC编辑框设置,输入、输出数据最多保留5位小数
- Qt中如何添加ICON图标 Qt设置应用程序图标
- HTML 特殊符号编码对照表
- B-tree/B+tree/B*tree