| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|Query to return row with max value|
Anyone know this off the top of their head?
COLUMNS visitor_id (VARCHAR), page_title (VARCHAR), visit_time (INT)
For a given visitor_id, I need to know the maximum visit_time and the page_title associated with it. Actually, I need a rowset with that data for each unique visitor_id.
Seems like this should have been easy, but it has stumped me.
If I understand the question:
SELECT page_title, MAX(visit_time)
GROUP BY visitor_id
I knew it was easy. I hate SQL.
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved