select eid from(select count(*) cnt,eid from certified group by eid)as foo where cnt=(select max(cnt) from (select count(*) cnt,eid from certified group by eid)as goo); This query displays the eid with maximum no of entries in the table certified. Which in this case is no. of aircraft licensed to an eid.
This query feels very processor heavy to me. How can i optimize it.
This is the table which contains the EID of pilots and AID refers to the id of aricraft they are licensed to fly.I need to find the pilot EID who is licensed to fly maximum no. aircraft.
The query i gave in the OP displays the correct result.But i want to optimize for better performance.
If you're in one of those predicaments where cls.__private attributes just aren't enough since they can easily be accessed through inst._cls__private, and you need something a little more secure, here's ...