当前位置:网站首页>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();
边栏推荐
- js中的break与continue退出
- Error: Cannot find module ‘D:\Application\nodejs\node_modules\npm\bin\npm-cli.js‘
- What is an EVM Compatible Chain?
- Judgment of database in SQL injection
- 最新MySql安装教学,非常详细
- vulhub靶场学习日记hackme2
- npm WARN config global `--global`, `--local` are deprecated. Use `--location solution
- 为什么redis是单线程还那么快?
- The feign call fails, JSON parse error Illegal character ((CTRL-CHAR, code 31)) only regular white space (r
- 一文速学-玩转MySQL获取时间、格式转换各类操作方法详解
猜你喜欢

最新MySql安装教学,非常详细

Access database query

数字孪生将成为进入“元宇宙”一项重要的途径

元宇宙的前景及四大赛道

Error: Cannot find module 'D:\Application\nodejs\node_modules\npm\bin\npm-cli.js'

What is an EVM Compatible Chain?

MySQL压缩包方式安装,傻瓜式教学

vulhub靶场学习日记xxe-lab

leetcode-每日一题1217. 玩筹码(贪心+位运算)

What is the difference between NFT and digital collection?
随机推荐
What is an EVM Compatible Chain?
vulhub靶场学习日记hackme2
阿里云中mysql数据库被攻击了,最终数据找回来了
leetcode-438. 找到字符串中所有字母异位词(滑动窗口)
SQL注入中数据库的判断
MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案
Volatility取证工具使用日记
leetcode-每日一题745. 前缀和后缀搜索(哈希和字典树)
计网 Packet Tracer仿真 | 简单易懂集线器和交换机对比(理论+仿真)
了解SSRF,这一篇就足够了
gin框架学习-Casbin进阶之策略管理API使用方法
MySQL高级SQL语句(二)
使用ps | egrep时过滤排除掉egrep自身
MySQL compressed package installation, fool teaching
C language tutorial (1) - preparation
Fragmented NFT (Fractional NFT)
常见JVM面试题及答案整理
Three-party login using wallet Metamask based on web3.0
什么是EVM兼容链?
2021 Mianjing - Embrace Change