答案 0 :(得分:3)
查找没有孩子的物品:
SELECT *
FROM table_name T1
WHERE NOT EXISTS (SELECT *
FROM table_name T2
WHERE T1.LineId=T2.ParentLineId)
答案 1 :(得分:0)
这样的东西?
Select *
From YourTable
Where LineID not in (Select Distinct ParentLineID From YourTable)