Table 1
person_id| location_id | field a | field b |friend_id
Table 2
location_id | location_name
friend_id is the id of a person liked by the given person ( it’s an optional field and the default value is zero )
How can I query the two tables to get the following :
the location_name of the person who has been liked by the maximum people and so on in decreasing order.
First, ensure you have an index on the Friend_ID column so it can be optimized in the query
EDIT — PER COMMENT on how to get most popular location based on people originations