Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Do I need a self join 1

Status
Not open for further replies.

EckyThump

MIS
May 15, 2007
33
GB
Looked everywhere and can not seem to find the answer, although I thinks its quite basic.
I am wanting to build a car maintenance type database that will help a beginner to do the tasks.
There are many tasks, but each task may and usually does involve other tasks.
For example: the task(1) to change the brake disk involves two other tasks: Task(2)jack car and Task(3) remove wheel.
I want to be able to select the task and show all related tasks preferably in the right order.
I tried copying the task table and creating a join between TaskID and RelatedTaskID and it shows the related tasks, but each task has other related tasks, for example, task(3) needs task(2) done first, but the RelatedTaskID field is already used.
See sample
I am struggling with this one, and would appreciate some advice to get me started I would be grateful!
 
Have you considered an additional table?

[tt]TaskID TaskID Order
1 3 3
1 7 1
1 41 2[/tt]
 
Thanks PHV thats extremly helpful and looks like it will do the job I want. The problem then comes when trying to list all the tools to carry out the master task (i.e. all child task tools!)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top