SELECT A.FOLLOW_SURVEY_CD,A.REVICE_CD FROM
(SELECT B.FOLLOW_SURVEY_CD, A.SURVEY_CD||B.SURVEY_DETAIL_CD AS REVICE_CD
FROM SMS_SURVEY A ,SMS_SURVEY_DETAIL B
WHERE A.SURVEY_ID=B.SURVEY_ID AND A.DATA_STATE='0' AND B.DATA_STATE='0' AND B.FOLLOW_SURVEY_CD IS NOT NULL) A
(SELECT B.FOLLOW_SURVEY_CD, A.SURVEY_CD||B.SURVEY_DETAIL_CD AS REVICE_CD
FROM SMS_SURVEY A ,SMS_SURVEY_DETAIL B
WHERE A.SURVEY_ID=B.SURVEY_ID AND A.DATA_STATE='0' AND B.DATA_STATE='0' AND B.FOLLOW_SURVEY_CD IS NOT NULL) A
WHERE A.REVICE_CD = 'surveyCd'
两个字段的值 拼接在一起