Advertisement
NInjaRasel

ld-portal | 4440 | sql

Dec 18th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. SELECT
  2. cdrd.*,
  3. ud.`name`,
  4. ud.`stage`
  5. FROM
  6. (SELECT
  7. cd.`consultation_id`,
  8. cd.`consultation_name`,
  9. cd.`venue_name`,
  10. cd.`nearest_station`,
  11. cd.`event_date`,
  12. rd.`user_id`,
  13. rd.`over_time`,
  14. rd.`fare`
  15. FROM
  16. consultation_data cd
  17. LEFT JOIN
  18. report_data rd
  19. ON
  20. cd.`consultation_id`=rd.`cm_id`
  21. WHERE
  22. cd.`event_date` >= '2016/12/20'
  23. AND
  24. cd.`event_date`<= '2019/12/20'
  25. AND
  26. cd.`property_id` = 1
  27. ORDER BY
  28. cd.`consultation_id`
  29. ) cdrd
  30. LEFT JOIN
  31. user_data ud
  32. ON
  33. cdrd.user_id=ud.user_id
  34. ORDER BY
  35. cdrd.consultation_id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement