SELECT aau.FIRST_NAME AS "Requester",smn.SURVEYNAME AS "Survey Name",srm.RESULT AS "Average Rating",CASE WHEN srm.result >=0 then 'DONE' else 'PENDING' END as "Survey Status" FROM Survey_Response_Main srm LEFT JOIN Survey_Main smn ON srm.SURVEYID=smn.SURVEYID LEFT JOIN AaaUser aau on srm.userid=aau.user_id where smn.typeid=4;
查询将包含填写人、调查名称、平均评分、调查状态。
SELECT aau.FIRST_NAME AS "Requester",smn.SURVEYNAME AS "Survey Name",sq.questext as "Survey Question",sra.answer as "Survey Answer",srm.RESULT AS "Average Rating",CASE WHEN srm.result >=0 then 'DONE' else 'PENDING' END as "Survey Status" FROM Survey_Response_Main srm LEFT JOIN Survey_Main smn ON srm.SURVEYID=smn.SURVEYID LEFT JOIN Survey_Response_Answer sra ON srm.responseid=sra.responseid LEFT JOIN Survey_Question sq on sra.quesid=sq.quesid LEFT JOIN AaaUser aau on srm.userid=aau.user_id where smn.typeid=4 ;