IT tutorials
 
Office
 

Microsoft Access 2010 : Enhancing the Queries That You Build - Working with Outer Joins

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Product Key Free : Microsoft Office 2019 – Serial Number
12/5/2014 3:40:06 AM

Outer joins are used when you want the records on the one side of a one-to-many relationship to be included in the query result, regardless of whether there are matching records in the table on the many side. With a Customers table and an Orders table, for example, users often want to include only customers with orders in the query output. An inner join (the default join type) does this. In other situations, users want all customers to be included in the query result, regardless of whether they have orders. This is when an outer join is necessary.

Establish an Outer Join

To establish an outer join, you must modify the join between the tables included in the query:

1.
Double-click the line joining the tables in the query grid.

2.
The Join Properties window appears (see Figure 1). Select the type of join you want to create. To create an outer join between the tables, select Option 2 or Option 3. Notice in Figure 1 that the description is Include All Records from Orders and Only Those Records from Order Details Where the Joined Fields Are Equal.

Figure 1. Establishing a left outer join.


3.
Click OK to accept the join. An outer join should be established between the tables. Notice that the line joining the two tables now has an arrow pointing to the many side of the join.

The SQL statement produced when this change is made looks like this:

SELECT Customers.CustomerID, Customers.CompanyName
FROM Customers
LEFT JOIN Orders ON Customers.CustomerID = Orders.CustomerID;

You can use an outer join to identify all the records on the one side of a join that don’t have any corresponding records on the many side. To do this, simply enter Is Null as the criteria for any required field on the many side of the join. A common solution is to place the criteria on the foreign key field. In the query shown in Figure 2, only customers without orders are displayed in the query result.

Figure 2. A query showing orders without order details.


 
Others
 
- Microsoft Access 2010 : Enhancing the Queries That You Build - Creating Totals Queries
- Microsoft Access 2010 : Enhancing the Queries That You Build - Using Aggregate Functions to Summarize Numeric Data
- Microsoft Project 2010 : Setting Up Project for Your Use - Defining Custom Fields
- Microsoft Project 2010 : Setting Up Project for Your Use - Defining Calendars (part 2) - Setting Project and Resources Calendar
- Microsoft Project 2010 : Setting Up Project for Your Use - Defining Calendars (part 1) - Calendar Hierarchy , Modifying and Defining Base Calendars
- Microsoft Visio 2013 : Creating a New Diagram - Connecting shapes with lines
- Microsoft Visio 2013 : Creating a New Diagram - Resizing and repositioning shapes
- Microsoft PowerPoint 2010 : Working with Charts - Modifying and Formatting Charts (part 3) - Formatting Charts
- Microsoft PowerPoint 2010 : Working with Charts - Modifying and Formatting Charts (part 2) - Modifying Your Chart’s Layout
- Microsoft PowerPoint 2010 : Working with Charts - Modifying and Formatting Charts (part 1) - Modifying Chart Design
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
Technology FAQ
- Is possible to just to use a wireless router to extend wireless access to wireless access points?
- Ruby - Insert Struct to MySql
- how to find my Symantec pcAnywhere serial number
- About direct X / Open GL issue
- How to determine eclipse version?
- What SAN cert Exchange 2010 for UM, OA?
- How do I populate a SQL Express table from Excel file?
- code for express check out with Paypal.
- Problem with Templated User Control
- ShellExecute SW_HIDE
programming4us programming4us