-----错误判断------------------------------------------------------------------------------------
SELECT
  policy_jq_no,policy_sy_no,
    CASE policy_jq_no
WHEN  '' THEN
    policy_sy_no
ELSE
    policy_jq_no
END policy_no
FROM
    ZY_SURVEY_VISIT order by FLOW_ID desc
 
---正确判断-----------------------------------------------------------------------------
  SELECT
  policy_jq_no,policy_sy_no,
    CASE
WHEN policy_jq_no IS NULL THEN
    policy_sy_no
ELSE
    policy_jq_no
END policy_no
FROM
    ZY_SURVEY_VISIT order by FLOW_ID desc
posted on 2017-02-19 19:40  塞北夜莺  阅读(1360)  评论(0编辑  收藏  举报