Reputation: 69
I have used the code below for finding the actor with max movies but I would need the third actor now:
SELECT CONCAT_WS(" ",actor.first_name,actor.last_name) AS Full_name
FROM actor INNER JOIN film_actor ON actor.actor_id = film_actor.actor_id
GROUP BY actor.actor_id
ORDER BY count(film_actor.actor_id) DESC
LIMIT 1;
Upvotes: 0
Views: 3384
Reputation: 1090
You can pass a second value to LIMIT which indicates the offset for the query. Passing 2 as the offset and 1 as the limit would give you just the third row.
SELECT CONCAT_WS(" ",actor.first_name,actor.last_name) AS Full_name
FROM actor INNER JOIN film_actor ON actor.actor_id = film_actor.actor_id
GROUP BY actor.actor_id
ORDER BY count(film_actor.actor_id) DESC
LIMIT 2, 1;
Upvotes: 2