Microsoft access self joins


Published on

Shows how to create a self join in Microsoft Access. A self join is a table joined to itself. This presentation uses employees reporting to their supervisor in the same table as an example.

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Microsoft access self joins

  1. 1. Orange Coast Database Associates Laguna Niguel, CA 92677 Factory2000 case Factory 2000 Case Self Joins 1
  2. 2.   A self join joins a table to itself This is useful for hierarchical relationships  Parts lists  Employee relationships (manager/supervisor)  Customer referrals  Etc.  This presentation shows how to create a query in Microsoft Access that joins a table to itself Factory 2000 Case Self Joins 2
  3. 3.   MgrNo is a foreign key in the employees table that refers to the table’s own primary key, EmpNo. We will create a query that lists each employee along with their manager’s name. Factory 2000 Case Self Joins 3
  4. 4.   This database is available on The presentation is on Slideshare. Factory 2000 Case Self Joins 4
  5. 5.  Below is a screenshot of the sample Employees table Factory 2000 Case Self Joins 5
  6. 6.  Add the Employees table to the query designer twice. The second time Access will give it the name Employees_1. Factory 2000 Case Self Joins 6
  7. 7.  Right click on the title of the 2nd Employees table and give it an alias of Managers. Factory 2000 Case Self Joins 7
  8. 8.   Create an outer join relationship between the two tables. This will show the employee even if they have no supervisor in the employees table (say the President). Populate the fields to be shown. Factory 2000 Case Self Joins 8
  9. 9.  Save the query and run it. Below are the results from our sample table. Factory 2000 Case Self Joins 9
  10. 10.   If desired the relationship of a table joined to itself can be created as a permanent link using the relationship designer. The example we used in this presentation is a one-to-many relationship (one employee reports to one manager, one manager may have several employees). Many to many relationships such as for matrix management are also possible by using a 3rd intersection table. Factory 2000 Case Self Joins 10
  11. 11.    This presentation showed how to create a simple self join query in Access. You should find many uses for this: reporting relationships, parts lists, customer referrals, etc. Go to Slideshare to find related Microsoft Access presentations. [end self joins] Factory 2000 Case Self Joins 11
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.