Advertisement
anne-hasan

aspek_kk_issue_2.1_check

Oct 25th, 2021
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. SELECT
  2. jawaban.*,
  3. files.id,
  4. files.created_at,
  5. files.disk_name,
  6. files.file_name,
  7. files.attachment_id,
  8. CONCAT(
  9. "https://aspek.ombudsman.go.id/storage/app/uploads/public/",
  10. CONCAT(
  11. SUBSTRING(files.disk_name, 1, 3),
  12. "/",
  13. SUBSTRING(files.disk_name, 4, 3)),
  14. CONCAT(
  15. "/",
  16. SUBSTRING(files.disk_name, 7, 3),
  17. "/", files.disk_name)
  18. ) AS 'Url Path'
  19.  
  20. FROM
  21. aspek_kepatuhan_detail_jawaban as jawaban
  22. LEFT JOIN
  23. system_files as files ON files.attachment_id = jawaban.id
  24. JOIN
  25. aspek_kepatuhan_profile_responden as responden ON responden.id = jawaban.profil_responden_id
  26. WHERE
  27. responden.id IN (
  28. SELECT
  29. responden.id
  30. FROM
  31. aspek_kepatuhan_profile_responden as responden
  32. WHERE
  33. institution_id = (
  34. SELECT
  35. institution_id
  36. FROM
  37. aspek_kepatuhan_profile_responden
  38. WHERE
  39. id = 37832
  40. )
  41. ORDER BY
  42. responden.id
  43. )
  44. AND jawaban.questions_id = 20
  45. ORDER BY
  46. jawaban.profil_responden_id, jawaban.questions_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement