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

Home -> Community -> Usenet -> comp.databases.theory -> Re: getting the maximum from multiple returns

Re: getting the maximum from multiple returns

From: --CELKO-- <71062.1056_at_compuserve.com>
Date: 24 Apr 2003 19:31:22 -0700
Message-ID: <c0d87ec0.0304241831.78adf092@posting.google.com>


>> I have a query where I'm attempting to select the maximum of the
records [sic] returned. That is to say it will return multiple records [sic] with the same primary key [sic], and of those I want the one with the highest percentage as indicated in the sample of returned data below. <<

Rows are not records; primary keys are BY DEFINITION unique. Only scalar values have a max. This posting makes no sense.; Since you also did not bother to post any DDL, we can only guess as to what things look like. You show three columns in your sample data (no column names!!) and four columns in your query.

Here is a wild guess, based on the specs you did not post.

SELECT H1.parcel_number, H1.perc_complete,

       H1.occupied_date, V1.occ_mkttl
  FROM ascend30:informix.occ_history AS H1,

       ascend30:informix.occup_values AS V1  WHERE H1.perc_complete

If your boss makes you work from specs like this, I hope you get paid by th hour. Received on Thu Apr 24 2003 - 21:31:22 CDT

Original text of this message

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