Gossamer Forum
Home : General : Databases and SQL :

Most recent from each category

Quote Reply
Most recent from each category
I'm trying to write a MySQL query for a database that displays pictures. Each picture is in a category and the record includes the date that the record was added to the database. In addition to having links which display the categories, I'd like to have one that displays the most recent image in each category. That way, people can see if there's anything new since the last time they looked at the whole category. (I'm also ordering the category by date, descending, so the most recent image is displayed first.)

I can't seem to figure out the syntax for the query to find the most recent in each category, though. I could do a query for each category, but that seems excessive.


JPD
----------------------------------------------------
JPDeni's DBMan-ual
How to ask questions the smart way.
Subject Author Views Date
Thread Most recent from each category JPDeni 6843 Jul 21, 2006, 2:43 PM
Thread Re: [JPDeni] Most recent from each category
Andy 6488 Nov 9, 2006, 4:17 AM
Post Re: [Andy] Most recent from each category
JPDeni 6386 Nov 9, 2006, 6:17 AM