SQLite COUNT() with HAVING Clause
In the Having clause, we will specify the condition and based on that the result displayed. Having clause works on the group by clause and the conditions are applied to the groups that are created by group by clause.
Let’s find out department which has more than or equal to 2 students enrolled in it.
Query:
select count(), dept
from faculty
group by dept
having count(dept)>=2;
Output:
Explanation: Thus, one row is returned with the department count where the count of the department number is greater than or equal to 2.
SQLite COUNT
SQLite is a serverless database engine, it is written in C programming language and is easy to use and store the data. It is one of the most used database engines. It is widely used for the development of Embedded applications. In this article we will learn about the SQLite count, how it works and what are all the other functions that are used with SQLite to get the desired output.