Joining data sources in a query in axapta

Joining data sources in a query in axapta

InnerJoin Will return the records where the joined data sources have matching values in the joined fields.
For example: By using the firstTable as the primary data source and using secondTable as the joined data source, the inner join will fetch all records from the firstTable where there is a corresponding record in the secondTable. The corresponding records in secondTable will also be fetched.

OuterJoin Will return all the records from the joined table even if they don't match the joined field.
For example: Compared to the example using the InnerJoin, this will return all records from the firstTable, but also records from the secondTable that does not have a match in the firstTable.

ExistsJoin This is just like the InnerJoin, except the records from the joined data source are not returned. They are only used to filter the primary data source.
For example: In our example, it will only return records in the firstTable where there is a match in the secondTable. Records from the secondTable will not be fetched.

NotExistsJoin This is the opposite of ExistsJoin. It will select records from the primary data source when matching records in the joined data source does not exist.
For example: In our example, it will return records from the firstTable that did not have any matching records in the secondTable. (firsts that have never been rented).