如果sql中没有值,则列应返回null

时间:2015-02-15 06:05:03

标签: sql oracle

现在在下面的查询中,我将获取一些列详细信息。

SELECT   sv.segment1, NVL (sit.object_version_number, 1),
                  sit.analysis_criteria_id, MAX (sit.person_analysis_id)
             INTO p_medical_id, p_per_object_version_number,
                  p_analysis_criteria_id, p_person_analysis_id
             FROM fnd_id_flex_structures_tl sttl,
                  fnd_id_flex_structures st,
                  per_person_analyses sit,
                  per_analysis_criteria sv
            WHERE sttl.id_flex_structure_name = 'ISPs Medical Data'
              AND sttl.LANGUAGE = USERENV ('LANG')
              AND st.id_flex_code = sttl.id_flex_code
              AND st.id_flex_num = sttl.id_flex_num
              AND st.id_flex_num = sit.id_flex_num
              AND st.id_flex_num = sv.id_flex_num
              AND sit.analysis_criteria_id = sv.analysis_criteria_id
              AND sit.person_id = i.person_id
         --and sv.SEGMENT1 = '4602001140'
         GROUP BY sv.segment1,
                  NVL (sit.object_version_number, 1),
                  sit.analysis_criteria_id;

如果列没有返回任何值,我想退出null。我尝试用null做但我没有得到任何行。

0 个答案:

没有答案