Answer the question
In order to leave comments, you need to log in
How to find out the number of 1s in a sqlite column?
I work with sqlite3 in Python
There is a users table, how to find out the number of 1 from a certain column (with numbers 1,2,3)?
For example, in a column five 1, three 2 and ten 3. How can I display the number 5 (amount 1)
xxx = cur.execute("SELECT COUNT(*) FROM users GROUP BY '%s' HAVING '%s' == 1" % (mmnl, mmnl,)).fetchone()
print(xxx)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question