我正在为Lumen项目使用Laravel迁移,其中我有树类型表:| id | name | parent_id。但是我需要使用外键。我只是感兴趣,下面的解决方案是否是一个好的解决方案?还是有更好的解决方案?
MP <- data.table(
M = c("m1","m1","m1","m2","m2", "m1"),
P = c("p1","p2","p4","p1","p3", "p1")
)
MK <- data.table(
M = c("m1","m1","m2"),
K = c("k1","k2","k1")
)
FINAL EXPECTED RESULT
M P K
m1 p1 k1
m1 p1 k2
m1 p2 k1
m1 p2 k2
m1 p4 k1
m1 p4 k2
m2 p1 k1
m2 p3 k1