Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Single Table Tree Structure - Find "Upline", Find "Downline"

Featured Replies

  • Newbies

Single Table Tree Structure Database.

Every record has a unique ID and a parent ID.

The Parent ID always matches some other records unique ID

A Parent can have multiple Children.

A child only has a single parent.

The root record has a parent ID that matches it's own ID (or zero if you like)

Given any ID I need to be able to search up through the tree to find the first parent record or parents parent record etc that has a character field = "Diamond". If not found I need to be able to return the root record.

Given the same ID I need to be able to provide a list of all the children, childrens children etc of the given record ordered by name or ID.

When displaying any record it would be great to be able to display who the parent is that is "Diamond" and list all the children as well.

Both functions would seem to require recursion but this is a little beyond me.

See whether this thread is any help

http://fmforums.com/forum/topic/58493-immediate-and-extended-families/page__p__276742#entry276742

See also:

http://fmforums.com/forum/topic/54969-recursing-down-to-root-in-a-table-representing-a-logical-tree/

http://fmforums.com/forum/topic/62995-directory-calculation/page__p__298035#entry298035

http://fmforums.com/forum/topic/72391-getting-more-out-of-filtered-portals-6-hierarchical-portal/page__hl__filtered__fromsearch__1

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.