I have a primary keyed access log table in MySQL with a column, say "section".
I am trying to get the most recent entry for multiple "section" values ie. main, settings, etc.
Am looking to do this in the quickest, most efficient way possible without multiple queries or an entire dump of the whole table each time, ie. to avoid SELECT * FROM table WHERE section = 'main' ORDER BY id DESC LIMIT 1
x however many sections am requesting (which is all of them) or SELECT * FROM table WHERE section = 'main' OR section = 'settings' OR etc... ORDER BY id
and have a gajillion rows of data running around from server-to-script kind of deal.
I am requesting the data on behalf of a variable number of "section" panels that display when each was last accessed.
Is there a quick, single query that can return only the information needed (if there are 3 sections I need 3 unique rows, the most recent of each section, unless or course 1 section is not present in the table in which case I would need those that are) or must I essentially dump the whole table and parse it "myself" in PHP to obtain what I need?