I have found a very complex query that connects eight (8) different tables. For this question, however, I simplify it with this type of structure: table table 1 (packet id int, activity int, mpid int , Partno Worker (20)) Insert values in Table 1 (1, 1, 132, 'ABC 123'), (1, 2, 132, 'ABCSERA'), (1, 3, 132, 'def 123'), ( 1, 4, 132, 'Diff 94'), (2, 5, 228, 'xyz123'), (3, 6, 239, 'xyz321'), (3, 7, 239, 'AAAA 000') This type of table creates the following output: | _P_P | _R_ | _Emp_ | _PartNo_ | | _1_ | _1_ | _132_ | _abc123_ | | _1_ | _2_ | _132_ | _abc465_ | | _1_ | _3_ | _132_ | _def123_ | | _1_ | _4_ | _132_ | _def456_ | | _2_ | _5_ | _228_ | _xyz123_ | | _3_ | _6_ | _239_ | _xyz321_ | | _3_ | _7_ | _239_ | _aaa000_ | I kept it a bella here: I was told that they do not really need PacketID or RequestID , but whatever they need is anything that shows how many requests are in the packet and which number of t...