SELECT CASE other_msg WHEN IS NULL THEN CONCAT(ref_code_desc, other_msg) ELSE ref_code_desc END
 FROM reference_code a, inq_response b WHERE a.ref_code_domain='QUESTION'
 AND  a.ref_code=b.question_id AND a.lang='EN'
 IS NULL 有语法错误, 要怎么改呢?IF (other_msg IS NULL) {
  CONCAT(ref_code_desc, other_msg)
} ELSE {
ref_code_desc
}

解决方案 »

  1.   

    CASE 
        WHEN isnull(other_msg) THEN CONCAT(ref_code_desc, other_msg) 
        ELSE ref_code_desc 
    END CASE
      

  2.   

    SELECT CASE WHEN  other_msg IS NULL THEN CONCAT(ref_code_desc, other_msg) ELSE ref_code_desc END
     FROM reference_code a, inq_response b WHERE a.ref_code_domain='QUESTION'
     AND a.ref_code=b.question_id AND a.lang='EN'