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

Home -> Community -> Usenet -> c.d.o.misc -> Help with dynamic case select?

Help with dynamic case select?

From: <kimberly.shaffer_at_gmail.com>
Date: Mon, 22 Oct 2007 13:56:03 -0700
Message-ID: <1193086563.891147.286350@e9g2000prf.googlegroups.com>


I've searched under dynamic and case sub select, but I am not sure if what I am asking for can be done in a straight sql query (new to sql, thanks!)

Here is an example:

select ta.field_name1,

        CASE ta.fieldname2
         select tb.fieldname2, tb.fieldname3 from TBL_b tb
		when ta.fieldname2 = tb.fieldname2 then tb.fieldname3
		else 'unknown, please look up'
        end as "Field_Name"

from
TBL_a ta
;

I am trying to pull a case select statement without having to type a long huge when...else statement. Thanks! Is this possible? Can someone point me towards what to look for?

Kimberly Received on Mon Oct 22 2007 - 15:56:03 CDT

Original text of this message

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