View Single Post
Old 02-26-2013, 11:11 PM   PM User | #2
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,650
Thanks: 4
Thanked 2,451 Times in 2,420 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
This may look confusing, so to clarify I merged together two posts. Each one had a link at the top and bottom, so there may be confusion between the two.

Anyways, you can use the MAX aggregate on this.
Code:
SELECT parent, MAX(`timestamp`) FROM table GROUP BY parent
You can add a WHERE clause for the parent if you have a specific id to work with as well.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
fondy98 (02-27-2013)