oracle - SQL: changing parameter driving output depending on condition -


i'm trying determine best approach. in have many entities , claims members of these entities. claims inherently don't have idea of entity, i'll have subquery bring membership , claims. question each entity has specific sources of claims included.

and claimource in (when entity 1 source & b, when entity 2 source a, when entity 3 source a, b, c)

and c.pd_prd_yyyymm between '201401' , (select to_char(sysdate - 45,   'yyyymm') dual) -- analyst adjust  , c.clm_src_cd in (when c.entity = 'entity 1' 'source a', when c.entity = 'entity 2' 'source & source b', etc...)  

i'm stuck on c.clm_src_cd part don't know if need case statement. conceptually going used in multiple spots. made great progress @ point, it's buried in thousands of crashed editors

i'm not sure if case statement appropriate here? appreciated.

thanks,

justin

while no expert in oracle sql, or close should it:

where... , ((c.entity = 'thing 1' , c.clm_src_cd in (select ... sourcea))      or (c.entity = 'thing 2' , c.clm_src_cd in (select ... sourceb))) 

using ands , ors allows work kind of case statement allows specify subqueries in in check.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -