Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> selecting the record with the latest date in a group.
On a table like this I’m trying to retrieve the last user to
visit every site.
Site last_visit User Site1 09/03/00 Steve [not selected] Site1 10/21/00 Roger [selected] Site2 10/15/00 Roger [not selected] Site2 11/06/00 Steve [selected] Site3 09/25/00 Scott [selected]
A query like "select site, max(last_visit) from table group by site" will return the sites and the last visit date.
I need to learn how to add, if it is possible, the user column to that last query.
I tried "select site, user, max(last_visit) from table group by site, user" but now it returns all the rows.
Any advice?
Saludos,
Orlando
Orlando M. Amador
Senior System Analyst
Ortho Biologics LLC
oamador_at_psgapr.jnj.com
Received on Thu Sep 06 2001 - 15:05:59 CDT