Yes, I guess I needed some database with their own language. So I did as you guys suggested, and first read in those with no connection, and then for each of those I read their subordinates, easy as cake :)

Thanks,


Trausti
On Apr 18, 2006, at 11:38 PM, Norman Palardy wrote:


On Apr 18, 2006, at 12:55 PM, Jay Wooten wrote:

You would be much better off separating the parent data into one table and the child data into another table and then doing a left outer join to grab all of the parents and if they have children in the child table, grab those.

- Jay

A hierarchical tree of data makes sense for lots of applications (boss & subordinates, etc) and SQL simply can't deal with that sort of data in a single query. It has no great way to traverse down an arbitrarily deep structure like. It's one place where and SQL language (like Transact SQL, PL/SQL, etc) or extensions like Oracle's are really required to traverse the data entirely in the database engine.
But it's easy to do in RB code

        bossid  employeeid
        NULL    1                       <--- the CEO
        1       2
        1       3
        1       4
        2       5       
        2       6
        3       7
        4       8       
        4       9
        5       10

should get (employees indented beneath their respective bosses)
        1
                2
                        5
                                10
                        6
                3
                        7
                4
                        8
                        9


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to