Skip to main content
A newer version of this page is available. .
All docs
V21.2

SelectQueryFluentBuilder.Join(String, SqlJoinType, String, String, String, ConditionType) Method

Joins two tables. Allows you to specify a table alias, the join operation type, column names by which the tables should be joined, and a relational operation that should be used to compare column values.

Namespace: DevExpress.DataAccess.Sql

Assembly: DevExpress.DataAccess.v21.2.dll

NuGet Packages: DevExpress.DataAccess, DevExpress.Win.Design

Declaration

public SelectQueryFluentBuilder Join(
    string tableName,
    SqlJoinType joinType,
    string tableAlias,
    string parentColumnName,
    string nestedColumnName,
    ConditionType compareOperator
)

Parameters

Name Type Description
tableName String

The name of the table (nested table) with which the current table (parent table) of the query builder should be joined.

joinType SqlJoinType

The join operation type.

tableAlias String

A table alias.

parentColumnName String

The parent table column name.

nestedColumnName String

The nested table column name.

compareOperator ConditionType

The relational operator type.

Returns

Type Description
SelectQueryFluentBuilder

A query builder that contains the join operation result.

Example

using DevExpress.DataAccess.Sql;
// ...
var query = SelectQueryFluentBuilder
    .AddTable("Categories")
    .SelectColumns("CategoryName", "CategoryID")
    .Join(tableName: "Products",
        tableAlias: "Products1",
        joinType: SqlJoinType.Inner,
        parentColumnName: "CategoryID",
        nestedColumnName: "CtgID",
        compareOperator: ConditionType.GreaterOrEqual)
    .SelectColumn("ProductName")
    .Join(tableName: "Products",
        joinType: SqlJoinType.RightOuter,
        keyColumnName: "ProductName")
    .SelectColumn("UnitPrice")
    .Build("Categories");
See Also