Selecting rows from one table using values gotten from another table MYSQL

前端 未结 5 595
暗喜
暗喜 2021-02-07 07:48

I have currently have 2 mysql tables in my db

Film and Film_Ratings_Report

The primary key for Film is filmid which is u

5条回答
  •  臣服心动
    2021-02-07 08:50

    Query:

    SELECT t1.* 
    FROM film t1 
    WHERE EXISTS (SELECT filmid 
                  FROM film_rating_report t2
                  WHERE t2.rating = 'GE'
                  AND t2.filmid = t1.id);
    

提交回复
热议问题