SQLite Forum

Select and count from 2 tables
Login
```
create table genremap(movie_id integer, name text);

insert into genremap
  values(1, 'Comedy'),
  (2, 'Romance'),
  (3, 'Romance'),
  (3, 'Comedy'),
  (4, 'Romance'),
  (4, 'Comedy');

select count(*) from genremap T1
where T1.name = 'Romance' and
  exists(
    select 1
    from genremap T2
    where T1.movie_id = T2.movie_id AND T2.name = 'Comedy'
  );

result:  2
```