Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要复制数据表中的一行及其子行。我必须迭代每个子表还是有更快的方法来做到这一点?
提前致谢。
编辑:我举一个例子:-行数据表“ParentTable”(主键“keyField”)-行数据表“ChildTable”(外键“keyField”)
我需要这个块的副本,我需要更改主键(以及约束的外键),然后删除原始行,但是这样做,我也松开了“ChildTable”行
您可以从用于构建数据表或使用fnGetData.
fnGetData
$('#yourTable').dataTable().fnGetData(rowNumber);
您可以查看更多数据的参考。
您可以使用 JOIN、LEFT JOIN、RIGHT JOIN 一下子获得您想要的所有结果。