Look at this image:
I want to select everything of tblPersons where all taskorders are connected to that person and where tblSteps.done = 0 and where tblPersons.id = a certain ID... needless to say: my head hurts and I can't seem to figure this one out. Any help is greatly appreciated.
The point of this datamodel is:
I want to make a database that contains 'workflows':
For example if I get a task (tblTasks) for a hollidayrequest, the workflow (tblWorkflows) to complete that task will contain two steps (tblSteps): the first step will be to fill in a form, the second step will be to grant that vacation or not and give a message why.
In that table tblSteps, for each step will be parameters and the field 'done' will indicate what step we're at in the workflow.
Differently said: to see what is on my personal todo list, I have to find the above querry.
Either suggestions on changing this datamodel to achieve the same or suggestions about solving this querry are greatly welcome!