i have two tables and i want to fill first table data with second one in condition that if employee 1 is in more than one group that the one which contains its neighbor also will be considered
Emp1,emp2,emp3,gp1,gp2,gp3
e1,e2,e3
Gp,emp
g1,e1
g2,e1
g2,e2
g3,e2
g4,e3
net result
e1,e2,e3,g2,g2,g4