SHARE
TWEET

Untitled

a guest Dec 18th, 2018 38 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top