Hej jeg r igang med at lave en opgave hvor jeg har to følgende tabeller
CAST_INFO: ID, MOVIE_ID, PERSON_ID, PERSON_ROLE_ID, NOTE, NR_ORDER
ROLE_TYPE: ID, ROLE
OPGAVE:
Find for each role the number of persons assigned to the roles order descending by the number.
Jeg har delvist løst opgaven men skal have sat de følgende to queries sammen til en query.
Håber der en der kan hjælpe
- SELECT count(role_id) AS num FROM cast_info GROUP BY(role_id) ORDER BY num desc;
-
- SELECT role FROM role_type WHERE id IN (SELECT role_id FROM cast_info);