Guest User

Untitled

a guest
Dec 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. SELECT t1.*, applications.status, applications.stage_name
  2. FROM application_stages t1
  3. JOIN (
  4. select application_id, max(exited_on) as exited_on
  5. from application_stages
  6. group by application_id
  7. ) t2
  8. USING (application_id,exited_on)
  9. join applications on application_stages.application_id = applications.id
  10. where application_id in ('91649746', '91991364', '96444221')
Add Comment
Please, Sign In to add comment