0
比方說這是我的表:如何找到在mysql中有2個actor的電影標題?
************
* film *
************
* title *
* film_id *
************
************
* actors *
************
* film_id *
* actor_id *
************
我想在其中找到兩個演員參與actor_id = 22 and actor_id = 23
如何編寫查詢的影片的片名?
我想:
SELECT title
FROM film
WHERE film_id IN(
SELECT film_id, COUNT(*)
FROM actors
WHERE actor_id=22 OR actor_id=23
GROUP BY film_id)