Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> SQL question - need to select only one row of a group-by result set?

SQL question - need to select only one row of a group-by result set?

From: David Van Zandt <dvanzandt_at_iquest.net>
Date: Mon, 08 Feb 1999 22:14:23 -0500
Message-ID: <36BFA80F.AA8F4EE3@iquest.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US