当前位置:网站首页>SQLite 查询表中每天插入的数量
SQLite 查询表中每天插入的数量
2022-07-31 05:15:00 【为今天而努力】
查询表中每天插入的数量,可以分析每天数据量,然后对代码优化。
// cloumnTime 时间值字段
StringBuffer sbfQuery = new StringBuffer("");
try {
Cursor cursor = sqLite.rawQuery("select date(" + cloumnTime + ") as day, count(*) as " +
"insert_count from " + tableName + " group by date(" + cloumnTime + ")", null);
while (cursor.moveToNext()) {
String day = cursor.getString(cursor.getColumnIndex("day"));
int insertCount = cursor.getInt(cursor.getColumnIndex("insert_count"));
sbfQuery.append(day).append("\t").append(insertCount).append("\n");
}
}catch (SQLException sqlE) {
sqlE.printStackTrace();
}
return sbfQuery.toString();
边栏推荐
- 动态规划(一)| 斐波那契数列和归递
- GUCCI, LV and other luxury giant universe how to layout yuan, other brands should keep up with?
- 代码块、Package,Import,封装(第六天)
- [Elastic-Job] Overview of Distributed Scheduling Tasks
- C语言 | 获取字符串里逗号间隔的内容
- Redis:简单实用
- [swagger close] The production environment closes the swagger method
- this指向问题
- js中的this指向与原型对象
- 永恒之蓝漏洞复现
猜你喜欢
[JVM Loading]---Class Loading Mechanism
Android软件安全与逆向分析阅读笔记
[Cloud native] Open source data analysis SPL easily copes with T+0
Year-end summary - the years are quiet~
MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案
工件SSMwar exploded 部署工件时出错。请参阅服务器日志了解详细信息
CMOS管原理,及其在推挽电路中的应用
Take you to understand the MySQL isolation level, what happens when two transactions operate on the same row of data at the same time?
最新MySql安装教学,非常详细
[Ubuntu20.04 installs MySQL and MySQL-workbench visualization tool]
随机推荐
什么是 GameFi?
[uiautomation] Get WeChat friend list (stored in txt)
npm WARN config global `--global`, `--local` are deprecated. Use `--location solution
Oracle数据库中的“limit”查询
2021年京东数据分析工程师秋招笔试编程题
Several solutions for mysql startup error The server quit without updating PID file
MySQL面试题大全(陆续更新)
为什么bash中的read要配合while才能读取/dev/stdin的内容
Why is the redis single-threaded also so fast?
sqlmap injection tutorial common commands
Android软件安全与逆向分析阅读笔记
【云原生】SQL(及存储过程)跑得太慢怎么办?
最新MySql安装教学,非常详细
MySQL compressed package installation, fool teaching
安装Multisim出现 No software will be installed or removed解决方法
Linux modify MySQL database password
Error: Cannot find module 'D:\Application\nodejs\node_modules\npm\bin\npm-cli.js'
leetcode-每日一题1217. 玩筹码(贪心+位运算)
纯shell实现文本替换
vulhub靶场学习日记hackme1