hi i have a database table , i want to set that as a tree structure and get the leaf nodes of that tree .
Recursive function can help you to generate parent/child tree. Find below link for more detail:
http://psoug.org/snippet/Recursive_function_to_generate_a_parentchild_tree_338.htm