简体   繁体   中英

Count strings in database table

I would like to know how to count choosed strings from database table. In one of my column are two strings called "correct" and "wrong". I have everything in array. I want to count how many strings called "correct" I have in column and how many called "wrong". I'm using sqlite.

You can try count(*) and a where.. something like:

SELECT Count(*) FROM yourTable WHERE yourColumn = 'wrong';

And another one to count the correct, or maybe you can subtract from the total.. I hope that helped!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM