SELECT t1.s_name, count(*) FROM tvSeries AS t1, subTitles AS t2, votes as t3
WHERE
t1.s_id IN (SELECT t2.s_id WHERE sLang='English') AND
t1.s_id IN (SELECT t3.s_id WHERE pts=5) AND
t1.s_id IN (SELECT t3.s_id WHERE uid='britney');
My tvSeries
table is like:
s_id s_cat s_name 1 comedy a 2 comedy b 3 drama c 4 comedy d 5 drama e
My subTitles
table is like:
s_id sLang 1 English 1 Spanish 2 French 2 English 3 English 1 French 4 German 4 English 5 English
My votes
table is like:
s_id uid pts 1 john 4 1 mia 3 1 britney 5 2 rock 5 3 anna 1 3 britney 5 4 megan 3 5 britney 5
I want to select total number of tvSeries
and name of tvSeries
in this conditions;
which tvSeries
gets 5 star from user 'britney'
with English subtitles.
When I use my code, I get only one row with number of tvSeries
but i want to see many rows with total value. Can anyone help me?