SQLiteDoneException when doing select().count() on empty table
See original GitHub issue long numpoints = new Select().from(ResponsePointData.class).count();
I expected that to do SELECT COUNT(*) FROM ResponsePointData
should probably just return 0 instead of throwing an error…
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Why count doesn't return 0 on empty table - Stack Overflow
just a thought: select ID from #empty_table will only return a result row, if the table has at least one row, however, select...
Read more >SQLiteStatement.simpleQueryForLong - Java - Tabnine
@Test public void simpleQueryTest() throws Exception { SQLiteStatement stmt = database.compileStatement("SELECT count(*) FROM `countme`"); assertThat(stmt.
Read more >SQLite Android Bindings: SQLiteStatement.java at tip
executeForLastInsertedRowId( getSql(), getBindArgs(), getConnectionFlags() ... For example, SELECT COUNT(*) FROM table; * * @return The result of the query.
Read more >Poor Performance on SELECT COUNT(*) from empty table ...
Hi @ all, after inserting a large no. of rows (> 100.000.000) into a table and deleting them at the same time, the...
Read more >SQLiteDatabase | Android Developers
Execute a single SQL statement that is NOT a SELECT/INSERT/UPDATE/DELETE. ... Using this flag is more efficient than calling enableWriteAheadLogging() .
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
oooo now I see it.
should be:
In 3.0 this query is a little more straightforward:
so
Method.count()
is an actual method ofCOUNT(*)
Added a
SQLite.selectCountOf()
method to make it easier/more clear.