armtuk: Cheetah (Default)
If you can even figure out how this works, Kudos. I'm pretty proud I figured out how to make this. There might be better ways, but this way works, and gets me what I need:

select * from task x, (select p.project_id, u.workflow_id, (select min(due_date) as min_due_date from task t where t.workflow_id=u.workflow_id) as min_due_date from task u, workflow p where u.workflow_id=p.workflow_id group by u.workflow_id, p.project_id) y where x.due_date=y.min_due_date and x.workflow_id=y.workflow_id;

Muhahahaha.

Profile

armtuk: Cheetah (Default)
armtuk

April 2017

S M T W T F S
      1
2345678
9101112131415
16171819 202122
23242526272829
30      

Syndicate

RSS Atom

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 24th, 2017 02:26 am
Powered by Dreamwidth Studios