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 -> Select not working

Select not working

From: Jim Poe <jpoe_at_fulcrumit.com>
Date: 2000/06/20
Message-ID: <8io2rl$j78@journal.concentric.net>#1/1

Oracle 8.1

I have the following data

Carr ID                                    St_ID    Beg_Dt
10002                                    10210     6/16/2000 13:56:25
10002                                    10211     6/16/2000 13:29:09
10002                                    10213     6/16/2000 13:34:50
10002                                    10215     6/16/2000 13:35:54
10002                                    10216     6/16/2000 13:34:39
10002                                    10219     6/16/2000 13:36:24

I use the following select against this data

SELECT A.*, A.ROWID

       FROM AUTH A
       WHERE A.CARR_ID=:CARR_ID AND
                      A.BEG_DT=(SELECT MAX( C.BEG_DT ) FROM AUTH C
                                           WHERE C.ST_ID=A.ST_ID )
       ORDER BY A.ST_ID

I get the following results:

Carr ID                                    St_ID   Beg_Dt
10002                                    10215    6/16/2000 13:35:54
10002                                    10216    6/16/2000 13:34:39
10002                                    10219    6/16/2000 13:36:24

Since the ST_ID column has a unique value in each of the rows, I should be getting all six rows in the result set. Can anyone tell me why I am not getting the expected results.

Thanks

--

Jim Poe ( jpoe_at_fulcrumit.com )

--

Jim Poe ( jpoe_at_fulcrumit.com ) Received on Tue Jun 20 2000 - 00:00:00 CDT

Original text of this message

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