计数的SQLite行 [英] Counting SQLite rows

查看:178
本文介绍了计数的SQLite行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何计算的行中的的SQLite 数据库表中的数字?我有一个称为表 my_table的,它有列名称 信息

How to count the number of rows in an SQLite database table? I have a table called my_table and it has columns name info and number.

推荐答案

您可以使用rawQuery COUNT(*)返回表中的行数。

You may use rawQuery count(*) which returns number of rows in a table.

   cursor=db.rawQuery("Select count(*) from my_table;", null);

这篇关于计数的SQLite行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆