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

Popular posts from this blog

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?

grails record upload problems

how i emanate permitted url asp.net mvc?