Reputation: 21
I have to find the actors appeared first most times.
Recital(opera,actor,character,appearingOrder)
i've tried in this way:
select distinct R1.Actor, count(R1.Actor) as nro
from Recital R1
where R1.AppOrd='1'
group by Actor
having max(nro)
but it returns an empty table. Thank You.
Upvotes: 2
Views: 923
Reputation: 6663
This would show the top actor, however if there was a tie, it would only show one of the actors:
select R1.Actor, count(R1.Actor) as nro
from Recital R1
where R1.AppOrd='1'
group by R1.Actor
ORDER BY nro DESC
LIMIT 1;
Upvotes: 1