Tree type calculation

Results 1 to 2 of 2

Thread: Tree type calculation

  1. #1
    Join Date
    Dec 1969

    Default Tree type calculation

    I have a table with "id" and "refid" fields. ids are uniqe and refids are multiple. Each id can refer n number of ids and become refid. A tree type calculation (with unlimited branches at all levels) is required with count of each level. how this can be done?

  2. #2
    Join Date
    Dec 1969

    Default RE: Tree type calculation

    Sounds like you&#039;re on the right track so far. When messages are displayed in ASP, the hyperlink should contain the unique ID.<BR><BR>If they hit an action of reply, the new entry will get a unique ID ( parent ID ), and also a refid ( Child ID ), which is the ID of the original message.<BR><BR>If they add a new post, it gets a unique ID, and no refid.<BR><BR>This way, selecting all from the table where refid is null will return all top-level nodes, and so forth. Throw this query into a SQL cursor-fetch, and use a while loop to sift down through all of it&#039;s childen.<BR><BR>Make sense?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts