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

Home -> Community -> Usenet -> c.d.o.server -> Re: Retrieve only recs that =1 and not > 1?

Re: Retrieve only recs that =1 and not > 1?

From: <jeff109_at_NOSPAM.netscape.net>
Date: Thu, 01 Jul 1999 14:06:05 GMT
Message-ID: <377b75be.2574301@news>


Hi,

This should do it for you:

select * from
(select IDNum, max(Status) max_status from Table group by IDNum) where max_status = 2

Hope this helps,
-Jeff Guttadauro

On 01 Jul 1999 01:53:00 GMT, zekmoe_at_aol.com (Zekmoe) wrote:

>Hello,
>I am trying to retrieve only the records in a table that are equal to a value,
>and don't have additional records with values greater. To clarify, the table is
>simplified like this:
>IDNum Status
> 123 1
> 123 2
> 123 3
> 124 1
> 124 2
> 125 1
> 125 2
> 125 3
>I need to get all the IDNum that are Status 2 but have not yet reached status
>3. Therefore I only need IDNum 124. Something like this
>(pseudo) Select IDNum from table where IDNum = 2 but not greater than 2;
>If I just specify < 3, I get 123 and 125 where the Status is 2.
>Any help greatly appreciated.
>Bob Maggio
>zekmoe_at_aol.com
Received on Thu Jul 01 1999 - 09:06:05 CDT

Original text of this message

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