If i perform a standard query in SQLite:
SELECT * FROM my_table
I get all records in my table as expected. If i perform following query:
SELECT *, COUNT(*) FROM my_table is not what you want, and it's not really valid SQL, you have to group by all the columns that's not an aggregate.
SELECT *, COUNT(*) FROM my_table
You'd want something like
SELECT somecolumn,someothercolumn, COUNT(*) FROM my_table GROUP BY somecolumn,someothercolumn