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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Obtain only first 6 characters in a column of all rows in the table?

Re: Obtain only first 6 characters in a column of all rows in the table?

From: Frank Kron <F.KRON_at_deutschepost.de>
Date: 2000/07/20
Message-ID: <3976ADC5.D7CE5B4B@deutschepost.de>#1/1

Hi,

try this:

select substr(columnA,1,6)
from prod
where substr(columnA,1,6) in
(select columnB
 from sale)

By
Frank

Maggie schrieb:

> If I only want to use first 6 characters in one column A to match the other
> column B with only 6 characters, can I still use RTRIM? However, I know
> the RTRIM is single row function. Hence, I am not sure whether I could
> run the following? Or do you have a correct way to implement this
> selection?
>
> Table prod: columnA varchar2(10)
> Table sale: colunmB varchar2(6)
>
> select RTRIM( columnA, 4) from prod where RTRIM( columnA, 4) in (select
> columnB from sale);
>
> Thanks.
> Maggie
Received on Thu Jul 20 2000 - 00:00:00 CDT

Original text of this message

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