dbTalk Databases Forums  

Help with dynamic case select?

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Help with dynamic case select? in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
kimberly.shaffer@gmail.com
 
Posts: n/a

Default Help with dynamic case select? - 10-22-2007 , 03:56 PM






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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.