当前位置:网站首页>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();
边栏推荐
猜你喜欢

leetcode-每日一题1252. 奇数值单元格的数目(模拟优化)

腾讯云GPU桌面服务器驱动安装

Memcached :安装

flutter 混合开发 module 依赖

动态规划(一)| 斐波那契数列和归递

【云原生】开源数据分析 SPL 轻松应对 T+0

Common JVM interview questions and answers

The server time zone value ‘й‘ is unrecognized or represents more than one time zone
![[uiautomation] Get WeChat friend list (stored in txt)](/img/26/1f3424c5998c52c6e10ced8529012a.png)
[uiautomation] Get WeChat friend list (stored in txt)

Linux中mysql密码修改方法(亲测可用)
随机推荐
vulhub靶场学习日记SickOs1.2
this指向问题
对js的数组的理解
带你搞懂MySQL隔离级别,两个事务同时操作同一行数据会怎样?
碎片化NFT(Fractional NFT)
纯shell实现文本替换
Access database query
Linux中mysql密码修改方法(亲测可用)
为什么redis是单线程还那么快?
CMOS管原理,及其在推挽电路中的应用
npm WARN config global `--global`, `--local` are deprecated. Use `--location解决方案
leetcode-每日一题873. 最长的斐波那契子序列的长度(哈希和二分)
C language tutorial (2) - printf and data types that come with c
[Ubuntu20.04 installs MySQL and MySQL-workbench visualization tool]
代码执行漏洞
Xiaobai learns reptiles - introduction to reptiles
安装Multisim出现 No software will be installed or removed解决方法
一个简单的bash转powershell案例
DeFi Token in the project management
UiBot存在已打开的MicrosoftEdge浏览器,无法执行安装