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 -> Decode in place of union?

Decode in place of union?

From: Compaq <david.spaisman_at_compaq.com>
Date: Mon, 14 Sep 1998 18:37:29 GMT
Message-ID: <01bde00f$46b525d0$12f21cac@dspaisman>


Hello:

In order to eliminate the need for a union for 601b and 601c(see join specs below, I would to use decode to do so.

The spec also calls for:

select 'MD' as Type, L2, L3, L8 from t601b UNION
select 'FT', L2, L3, L8 from t601c;

With this in mind, is there any way to use decode to avoid the union?

The way I have coded the union as follows_only partial shown):

t441a.l63 Track_Equipment_Code,
'MD' as Prod_Type,

.........

and t441a.l62 = 'MD'
and t101a.l3 = prop_prod_dtl_144.prop_hdr_uk union

................

t441a.l63 Track_Equipment_Code,
'FT' as Prod_Type,

............

.....
and t441a.l62 = 'FT'
and t101a.l3 = prop_prod_dtl_144.prop_hdr_uk;

Thanks.

David Spaisman


T233A L80 JOIN T235A L2
T233A L2 JOIN T238A L2
T233A L38 JOIN T238A L92
T233A L61 JOIN T238A L69
T233A L45 JOIN T257A L2
T233A L61 JOIN T101A L56
T238A L27 OUTER JOIN T441A L2 Select all records on T238A & only those records on T441A where the joined fields are equal T238A L27 OUTER JOIN PROP_PROD_DTL_144 PROD_ITEM_CD Select all records on T238A & only those records on PROP_PROD_DTL_144 where the joined fields are equal
T101A CLng(L3) JOIN PROP_PROD_DTL_144 PROD_HDR_UK L3 on T101A has to be converted from a character format to a long integer format in order to join with PROP_HDR_UK
T441A L11 JOIN T404A L2
T441A L63 JOIN Union of T601B & T601C L2 T441A L62 JOIN Union of T601B & T601C Type Received on Mon Sep 14 1998 - 13:37:29 CDT

Original text of this message

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