I have got this sql:
SELECT
artists.id,
actors.id,
actors.count
FROM
artists
INNER JOIN actors ON artists.title = actors.title;
Actors table have got duplications and some counter field. So there can be
Tom Waits | 10
Tom Waits | 30
How can I change my first sql so it will return only those actors, who have got MAX(count)
Something like
SELECT
artists.id,
actors.id,
actors.count
FROM
artists
INNER JOIN actors ON artists.title = actors.title
HAVING MAX(actors.count);
How about