I can't run this query in sqlite:
Cursor c = mDb.rawQuery(
"SELECT count(sim1.movie_id) FROM stars_in_movies sim1 WHERE "
+ "EXISTS ( SELECT 1 FROM stars_in_movies sim2 WHERE "
+ "sim1.movie_id = sim2.movie_id HAVING COUNT(*) = 4) "
, null);
This query gets all the movies in the stars_in_movies table that have four actors in them.
I get this run-time error: SQLiteException : A group by clause is required before having
This query runs in my Mysqln terminal, but it looks like sqlite doesn't like it. How can I change the above query to get the same results in SQLite?