diff --git a/scripts/answers_csv.sql b/scripts/answers_csv.sql new file mode 100644 index 00000000..af790b03 --- /dev/null +++ b/scripts/answers_csv.sql @@ -0,0 +1,11 @@ +SELECT ans.*, res.*, mapv.*, sur.*, que.* +FROM public.apiapp_answer AS ans, + public.apiapp_response as res, + public.apiapp_mapview as mapv, + public.apiapp_survey as sur, + public.apiapp_question as que +WHERE ans.response_id = res.response_id + AND res.survey_id = sur.id + AND ans.mapview_id = mapv.id + AND que.survey_id = sur.id +ORDER BY ans.id ASC