0

Example, there are machines that processes and produced materials, is there a way to track the output of machine becoming the input of another, and counting how many passes the process took? here is the example desired output (pass column):

Record# machine input output pass material
1 1 40422041 40422041 1 ABC74008000
2 2 40422041 40422041 2 ABC74004200
3 3 40422041 40422041 3 ABC74002100
4 4 40422041 A40422041 4 ABC74001200
5 4 40422041 40422041 4 ABC74001200
6 5 40422041 M421200629 5 ABC73000660
7 6 A40422041 M521200827 5 ABC73000660
8 6 A40422041 M521220239 6 ABC73000660

notice records 1,2,3,5 & 6 = these are all coming from input 40422041. records 4,7 & 8 are results of A40422041 which was an output of 40422041, thus the pass is needed to be 4 on record # 4, and continued as pass 5 and 6 on records 7 & 8.

How can the pass sequence be achieved?

Lazz
  • 1
  • 2
  • `records 1,2,3,5 & 6 = these are all coming from input 40422041` Why `record 4` is excluded? – Squirrel Jun 22 '22 at 07:06
  • In T-SQL you may want to look into graph objects https://learn.microsoft.com/en-us/sql/relational-databases/graphs/sql-graph-sample?view=sql-server-ver16 – Nick.Mc Jun 22 '22 at 07:11
  • @Squirrel - yeah just to highlight the scenario that on records 4 & 5, they run on the same machine with the same input and the output SPLIT into 2 thus they have the same pass – Lazz Jun 22 '22 at 07:27
  • How do you count the `pass` ? How do you determine which is the first pass ? – Squirrel Jun 22 '22 at 09:24

0 Answers0