Skip to content

Instantly share code, notes, and snippets.

@joffilyfe
Created December 1, 2015 10:14
Show Gist options
  • Save joffilyfe/49b858210c3e13a1af46 to your computer and use it in GitHub Desktop.
Save joffilyfe/49b858210c3e13a1af46 to your computer and use it in GitHub Desktop.
SELECT DISTINCT s.paper_id AS 'Submissao ID', s.setting_value AS 'Titulo',
(SELECT response_value FROM review_form_responses WHERE review_form_element_id = 6 and review_id = a.paper_id) AS '1',
(SELECT response_value FROM review_form_responses WHERE review_form_element_id = 7 and review_id = a.paper_id) AS '2',
(SELECT response_value FROM review_form_responses WHERE review_form_element_id = 8 and review_id = a.paper_id) AS '3',
(SELECT response_value FROM review_form_responses WHERE review_form_element_id = 9 and review_id = a.paper_id) AS '4',
(SELECT response_value FROM review_form_responses WHERE review_form_element_id = 10 and review_id = a.paper_id) AS '1',
(SELECT response_value FROM review_form_responses WHERE review_form_element_id = 11 and review_id = a.paper_id) AS 'Comentário'
FROM paper_settings s JOIN paper_authors a ON s.paper_id = a.paper_id
WHERE s.setting_name LIKE 'title' AND a.paper_id = 415
ORDER BY s.setting_value;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment