首页 > 代码库 > SQL导致数据减少

SQL导致数据减少

注:之前的外连接筛掉了cdl.aim_code为null的数据,改成临时表的写法。
From
           (select fv.description,
                     fv.flex_value
             from fnd_flex_values_vl fv,
                  fnd_flex_value_sets fvs
             where fv.flex_value_set_id = fvs.flex_value_set_id
                    AND fvs.flex_value_set_name = ‘20_INV_DOC_LINE_AIM_CODE‘
                    AND fv.enabled_flag = ‘Y‘
             ) AA
Where
        AND AA.FLEX_VALUE(+) = cdl.aim_code;
代替
From fnd_flex_values_vl fv,
        fnd_flex_value_sets fvs
Where
          AND fv.flex_value_set_id = fvs.flex_value_set_id
         AND fvs.flex_value_set_name = ‘20_INV_DOC_LINE_AIM_CODE‘
         AND cdl.aim_code = fv.flex_value(+)
         AND fv.enabled_flag = ‘Y‘

SQL导致数据减少