Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: another mental block - Help still wanted Pleeeeease!!!
> But what I need is
>
>
> N_ID V_ V_T V_VAL
> --------- -- --- ---------
> 1111 AV TLL 150
> 2222 AV TLP 100
> 3333 AV TQD 100
> 4444 AV 100
> 5555 AJ RDL 120
> 6666 AJ RPX 200
> 7777 AJ RPN 125
>
Don't know where this comes from:
> 6666 AJ RPX 200
but the rest could be:
jvmo_at_ids9i> l
1 select n.n_id, 2 n.v_cat, 3 n.v_type, 4 nvl((select v1.v_val from tclval v1 where n.v_cat = v1.v_cat and v1.v_type = n.v_type) 5 ,(select v2.v_val from tclval v2 where n.v_cat = v2.v_cat and v2.v_type is null) 6 ) as val2
N_ID V_ V_T VAL2
---------- -- --- ----------
1111 AV TLL 150 2222 AV TLP 100 3333 AV TQD 100 4444 AV 100 5555 AJ RDL 120 6666 AJ RPX 7777 AJ RPN 125
7 rows selected.
Of course, insert into tclval values ('AJ',null,200); will get you the result set you printed :-)
jan Received on Wed Nov 05 2003 - 15:59:05 CST