📌  相关文章
📜  如何使用sql代码示例在单个查询中获取父子记录

📅  最后修改于: 2022-03-11 15:04:58.051000             🧑  作者: Mango

代码示例1
SELECT child.Id,
       child.Name,
       child.ParentId,
       parent.Name as ParentName
FROM your_table child
JOIN your_table parent ON child.ParentId = parent.id;