SQL Subquery - return specific result -


edited: changes: reworded more ask question

problem: trying update data.

complications:

  1. the table updating is: p_far_sbxd.t_claim_service_typ_dim inner joining table table (p_far_stg_vw.v_claim_60_policy_stg) see missing in first table.
  2. i updating 2 fields. 1: coverage type code, found in second table. , 2: coverage type description found in lookup table, based on coverage type code
  3. the problem running updating description. code easy enough. example. m = cancer, f = ltc, etc.

here logic: if row has code of m, looked table , field description populated correct description.

query

select p_far_sbxd.t_claim_service_typ_dim.*, p_far_stg_vw.v_claim_60_policy_stg.coverage_typ_cde stg_ctc,

(select distinct p_far_cr_vw.v_rule_translation_element.translated_value_txt, p_far_cr_vw.v_rule_translation_element.input_value_txt p_far_cr_vw.v_rule_translation_element p_far_cr_vw.v_rule_translation_element.input_value_txt = p_far_stg_vw.v_claim_60_policy_stg.coverage_typ_cde , p_far_cr_vw.v_rule_translation_element.translation_catg_seq_id = 510) stg_ctd

from (inner joins occur here)

my sub query returns many values, in fact 16 of codes , descriptions. how can link sub query main query looking for?

i hope clearer last question.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -