SELECTR.member_id,R.ANSWER_TIMES,Q.question_no,Q.question_name,(CASEWHENQ.control_idin(0,1,2)and--A.free_text_flg is nullCOALESCE(A.free_text_flg,0)=0THENA.answerELSER.answerEND)ASanswer,to_char(R.insert_date,'yyyy/MM/dd HH24:MI:SS')ASinsert_datefromt_replyRINNERJOINm_answerAONR.enquete_id=A.enquete_idANDR.question_id=A.question_idANDA.DEL_FLG=0INNERJOINm_questionQONR.enquete_id=A.enquete_idANDR.question_id=A.question_idANDR.answer_id=A.answer_idANDR.question_no=Q.question_noANDQ.DEL_FLG=0WHEREQ.enquete_id=/*enquete_id*/ANDR.enquete_id=/*enquete_id*/andR.member_idbetween/*minMemberId*/and/*maxMemberId*/andR.member_idisnotnullORDERBYR.member_id,Q.question_no,A.answer_id