Home > database > SQL query tree view, not check not children of the parent
SQL query tree view, not check not children of the parent
Time:09-23
Built a view, field ids, parentID, LEAF The parent node parentID is empty, child nodes parentID is belong to the parent node ID How to filter out not children of the parent data line,
CodePudding user response:
LEAF field is all child nodes have the same value, the parent node is empty
CodePudding user response:
Select * The from t_aa1 t Where t.i d not in (select Amy polumbo arentid from t_aa1 a where Amy polumbo arentid is not null) And t.l eaf is null; Seems the SQL can meet your requirements