I am working with Room persistent database in my project. I have a table in which there is a column for Boolean values as in 0 or 1, now i want the count of all Boolean values w
Finally I got the perfect solution! Just add this method in the DAO class as follows:
@Query("SELECT COUNT(is_checked) FROM table WHERE is_checked = 1") int getNumberOfRows();
All thanks to Florina Muntenescu at https://medium.com/@florina.muntenescu