SELECT actor.first_name,actor.last_name,COUNT(*)
FROM actor
INNER JOIN film_actor USING(actor_id)
GROUP BY actor.actor_id;
actor和film_actor换一下,也没产生临时表。
FROM actor
INNER JOIN film_actor USING(actor_id)
GROUP BY actor.actor_id;
actor和film_actor换一下,也没产生临时表。
2018-03-08
为什么不直接使用左外连接:EXPLAIN SELECT a.first_name, a.last_name, count(*) FROM film_actor f LEFT JOIN actor a USING (actor_id) GROUP BY f.actor_id
2018-02-02