Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Your ideas will be helpful
Helen:
How about a select statement that will do it for
you instead of all the looping? Does this work?
select
asset_num , decode(min(num), 1,
'DHI', 2, 'AHI', 3, 'CHI', '???') as company_id from
(select asset_num
,
decode(company_id, 'DHI', 1, 'AHI',2, 'CHI', 3, 4) as num
from
assets)group by asset_num;
Hope this helps.
Jon Walthour
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
To: <A title=ORACLE-L_at_fatcity.com
href="mailto:ORACLE-L_at_fatcity.com">Multiple recipients of list ORACLE-L
Sent: Wednesday, August 01, 2001 5:12
PM
Subject: Your ideas will be helpful
Hello, all:
I'm import data from schema1.table1 (<FONT face=Courier
size=1>ASSET_NUM,COMPANY_ID,CONSOLI_ID……) to
schema2.table2 (<FONT face=Courier
size=1>ASSET_NUM,COMPANY_ID,CONSOLI_ID……)using SQL script on Oracle 8i.
The situation is like this:
In schema1.table1, it does not has a Primary Key and
Table1.ASSET_NUM has
duplicated records while values in COMPANY_ID
are different. For example:
ASSET_NUM COMPANY_ID ---------- ---------- AA237334
Do You Yahoo!?Make international calls for as low as $.04/minute
with Yahoo! Messenger<A
href="http://phonecard.yahoo.com/?.refer=mailtagline">http://phonecard.yahoo.com/
Received on Fri Aug 03 2001 - 13:38:30 CDT
![]() |
![]() |