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

Fragmented NFT (Fractional NFT)

Memcached :安装

Gradle sync failed: Uninitialized object exists on backward branch 142
![[uiautomation] Get WeChat friend list (stored in txt)](/img/26/1f3424c5998c52c6e10ced8529012a.png)
[uiautomation] Get WeChat friend list (stored in txt)

场效应管 | N-mos内部结构详解

对js的数组的理解

Powershell中UTF-8环境中文乱码解决办法

MySQL错误-this is incompatible with sql_mode=only_full_group_by完美解决方案

The latest MySql installation teaching, very detailed

leetcode-每日一题873. 最长的斐波那契子序列的长度(哈希和二分)
随机推荐
Artifact SSMwar exploded Error deploying artifact.See server log for details
元宇宙的前景及四大赛道
js中的全局作用域与函数作用域
What is GameFi?
一个简单的bash转powershell案例
leetcode-2321. 拼接数组的最大分数(差分+枚举)
MySQL高级学习笔记
数字取证autopsy工具用法
Linux修改MySQL数据库密码
[JVM Loading]---Class Loading Mechanism
Take you to understand the MySQL isolation level, what happens when two transactions operate on the same row of data at the same time?
【ubuntu20.04安装MySQL以及MySQL-workbench可视化工具】
计网 Packet Tracer仿真 | 简单易懂集线器和交换机对比(理论+仿真)
this指向问题
MySql创建数据表
On the side of Ali, tell me what are the application scenarios of message middleware you know?
2021年京东数据分析工程师秋招笔试编程题
[windows]--- SQL Server 2008 super detailed installation tutorial
The MySQL database in Alibaba Cloud was attacked, and the data was finally recovered
[Elastic-Job] Overview of Distributed Scheduling Tasks