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.

Examples of a Self-Join

Featured Replies

  • Newbies

Just learning this db and having a lot of fun with the relationships. I have created examples of one to one relationships and understand the portals to display the one to many. I still have yet to discover a good example of why I would want to use a self-join. Would it not be quicker to create 2 files and define a one to one or does it utilize less cpu to perform a self-join?

I guess I have hit a wall because I don't understand how you define a relationship between different match fields. I am still thinking the fields must be equal. The help file did not make it clearer to me. Help anyone?

quote:

Originally posted by appdemon:

Just learning this db and having a lot of fun with the relationships. I have created examples of one to one relationships and understand the portals to display the one to many. I still have yet to discover a good example of why I would want to use a self-join. Would it not be quicker to create 2 files and define a one to one or does it utilize less cpu to perform a self-join?

I guess I have hit a wall because I don't understand how you define a relationship between different match fields. I am still thinking the fields must be equal. The help file did not make it clearer to me. Help anyone?

A self-join is not typically part of a relational database structure. A self-join is a convienent way to perform finds and summarizations.

For instance, let's say that you are looking at customer records and want a count of all customers in the same zip code to be shown on the screen.

Easist way is to do a self-join by Zip Code and setup a calculation Count (Self by ZipCode::CustomerID).

Some procedures may want to work ONLY on the current record. Well you may want to insure that you are only working on ONE record, so you do a Go To Related Record [self by CustomerID, Show Only Related Records].

And I could go on and on.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Senior Filemaker Developer

http://www.database-resources.com

mailto:[email protected]

=-=-=-=-=-=-=-=-=-=-=-=-=

quote:

Originally posted by appdemon:

Just learning this db and having a lot of fun with the relationships. I have created examples of one to one relationships and understand the portals to display the one to many. I still have yet to discover a good example of why I would want to use a self-join. Would it not be quicker to create 2 files and define a one to one or does it utilize less cpu to perform a self-join?

I guess I have hit a wall because I don't understand how you define a relationship between different match fields. I am still thinking the fields must be equal. The help file did not make it clearer to me. Help anyone?

For a good discussion on the uses of self-joins and the many ways you can use them, check out Scriptology by Matt Petrowsky and John Mark Osborne. It's available at store.filemakerworld.com. I think it's the most valuable book on FileMaker available.

Chuck

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.