在sqlite中怎么统计本周本月数据
来源:互联网 发布:使用软件侵权鉴定 编辑:程序博客网 时间:2024/05/19 16:02
sqlite中有个表UserConsume,其中有一列rowTime,该列类型是datetime,怎么统计该表本月和本周的数据?sql如下:
--本月select *from UserConsumewhere rowTime between datetime('now','start of month','+1 second') and datetime('now','start of month','+1 month','-1 second') --本周select *from UserConsumewhere rowTime between datetime(date(datetime('now',strftime('-%w day','now'))),'+1 second') and datetime(date(datetime('now',(6 - strftime('%w day','now'))||' day','1 day')),'-1 second')
主要用的函数有datetime和strftime,具体用法,请参阅官网:http://www.sqlite.org/lang_datefunc.html
sql,请参阅:http://sqlite.org/lang.html
数据类型,请参阅:http://sqlite.org/datatype3.html
- 在sqlite中怎么统计本周本月数据
- 在SQLite中统计本周本月数据的代码实例
- Mysql统计昨日今日本月本周数据
- sql 本日\本周\本月统计
- SQL的本月统计和本周统计
- SQLServer的本月统计和本周统计
- oracle 中查询本年、本月、 本周的数据
- sql 获取本周、本月数据
- Sqlite获取本周数据
- 【SQLServer】SQL的本月统计、本周统计和本季度统计
- 在cocos2dx中怎么使用sqlite来纪录数据
- 获取当天、本周、本月相关的数据
- 求本年、本月、本周等数据
- oracle 查询本周,本月,本年数据
- sql 当天、本周、本月数据查询
- sql语句获取本周、本月数据
- oracle 查询本周,本月,本年数据
- linq 查询本周 本月 的数据
- c/c++内存分配、指针和数组对比
- Win XP必须禁止的服务
- Android线程封装基类Thread
- dojo的connect方法使用与源代码剖析(在JavaScript里实现类似AOP的效果)
- C# DLL库自动注册的两种方法(调用Regsvr32法、调用DllRegisterServer函数法)
- 在sqlite中怎么统计本周本月数据
- iphone 中两张图合为一张图片
- Android 广播机制
- Hadoop源代码分析
- 编写ant:build.xml的方法
- Oracle 10g 入门须知---[Oracle 10g]
- gambit多面整合
- linux-sfdisk 用法
- BYTE和CBitmap之间的转换