find root nodes hierarchical tree
i have list database stores tree structure. here applicable fields:
mytree (id, parentid, otherfields...)
i wish root nodes (that is, any record whose id another record's parentid)
i've attempted this:
select * mytree where `id` (select graphic `parentid` `mytree`)
but returned an lifeless set. strangely, stealing "not" advantage set non-leaf nodes.
can anyone where i'm going wrong?
update: interjection answers folks, have repremand worked me. i've supposed daniel's given also explains since query didn't work (the zero thing).
Comments
Post a Comment