Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT t1.*, applications.status, applications.stage_name
- FROM application_stages t1
- JOIN (
- select application_id, max(exited_on) as exited_on
- from application_stages
- group by application_id
- ) t2
- USING (application_id,exited_on)
- join applications on application_stages.application_id = applications.id
- where application_id in ('91649746', '91991364', '96444221')
Add Comment
Please, Sign In to add comment