| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> SQL question - need to select only one row of a group-by result set?
Hi all, and yes, I've been reading TFM for two days now. Just in case
I'm beating my head neadlessly, I'm asking for help parsing a SQL query.
Seems simple enough: the need is to query one table, returning such columns as a product_key, date last updated, and time last updated. I obviously need to use GROUP-BY in order to utilize the MAX function, but my queries generate all of the rows that fulfill the group-by constraints -- not just the one maximum-value row.
I've played with rownum, only to find it's relative to the result set. I'd have to save an intermediate table, then do a second query to obtain it that way.
Am I missing something basic? I'm stumped, and would welcome your suggestions. TIA.
--
Dave Van Zandt
dvanzandt at iquest.net
Received on Mon Feb 08 1999 - 21:14:23 CST
![]() |
![]() |