select * from tableName
start with parent=0
connect by prior child=parent