Join data in queries

denzel

New Member
Nov 20, 2024
1
0
1
The biggest advantage of using queries comes from their ability to join data from multiple tables into a single resulting dataset. Therefore, you would usually model queries to include multiple data items that are joined to combine the data from multiple tables into a single resulting dataset.

You can join a data item to another data item by indenting it under another data item. The data item under which you have indented another data item becomes the parent data item. Each parent data item can have only one child data item.

When you indent data items under one another, you only specify that the data from one table will be joined to the data from another table. However, you have not defined how the data will be joined. To define the data joining rules, use the following data item properties:

  • DataItemLink - Sets a reference between one or more fields of the source table of the current data item and fields of one or more source tables of the data item(s) that are higher in the data model hierarchy. You can link them by using the name of the data item.
  • SqlJoinType - Defines how the resulting dataset should handle the rows from the current data item if no match occurs between values that were specified in the data item link and data items that are higher in the data model hierarchy.
    • CrossJoin - Contains rows that combine each row from the upper data item table with each row from a lower data item table. Cross joins are also called Cartesian products. A cross join doesn't apply comparisons between columns of data items, so the DataItemLink property is left blank.
    • FullOuterJoin - Contains all records from the upper data item table and all records from the lower data item, including records that do not have a matching value for columns that are linked by the DataItemLink property.
    • InnerJoin - Creates a dataset by combining records from data item tables where a match is found between the columns that are linked by the DataItemLink property of the lower data item. Inner join uses an equal to comparison operator to match rows from the lower data item table with rows from the upper data item table that is based on the values of the linked columns.
    • LeftOuterJoin - Resembles the InnerJoin, except that the resulting dataset contains every record from the upper data item table, even if a record doesn't have a matching value in the lower data item for columns that are linked by the DataItemLink property.
    • RightOuterJoin - Resembles the InnerJoin, except that the resulting dataset contains every record from the lower data item table, even if a record does not have a matching value in the upper data item for columns that are linked by the DataItemLink property.

oracle certification malaysia
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!