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

Re: Select not working

From: <ddf_dba_at_my-deja.com>
Date: 2000/06/20
Message-ID: <8iogsm$o08$1@nnrp1.deja.com>#1/1

In article <8io2rl$j78_at_journal.concentric.net>,   "Jim Poe" <jpoe_at_fulcrumit.com> wrote:
> 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 )
>
>

The fact that you are getting three of the six rows indicates that the select is working. My thought is that the Carr ID value in the other columns is not exactly the same as in the three returned rows. You might want to verify that the Carr ID is, indeed, the same for all rows. There may be a control character in the remaining CARR_ID values. Since this wouldn't print on the screen you may have to spool output to a file and use a simple text editor to see the differences. I can see no other reason for this type of behavior (but, then, I've been wrong before).

--
David Fitzjarrell
Oracle Certified DBA


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Tue Jun 20 2000 - 00:00:00 CDT

Original text of this message

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