Skip to main content
All docs
V24.2

SelectQueryFluentBuilder.Join(String, String, SqlJoinType, RelationColumnInfo[]) Method

Joins two tables. Allows you to specify a table alias, the join operation type, and columns relations by which the tables should be joined.

Namespace: DevExpress.DataAccess.Sql

Assembly: DevExpress.DataAccess.v24.2.dll

Declaration

public SelectQueryFluentBuilder Join(
    string tableName,
    string tableAlias,
    SqlJoinType joinType,
    params RelationColumnInfo[] keyColumns
)

Parameters

Name Type Description
tableName String

The name of the table with which the current table of the query builder should be joined.

tableAlias String

A table alias.

joinType SqlJoinType

The join operation type.

keyColumns RelationColumnInfo[]

An array of column relations.

Returns

Type Description
SelectQueryFluentBuilder

A query builder that contains the join operation result.

Example

using DevExpress.DataAccess.Sql;
// ...
var query = SelectQueryFluentBuilder
    .AddTable("Customers")
    .SelectColumns("ContactName", "City")
    .Join(tableName: "Employees",
        tableAlias: "Employees1",
        joinType: SqlJoinType.Inner,
        keyColumns: new[] {
            new RelationColumnInfo(
                parentKeyColumn: "City",
                nestedKeyColumn: "City",
                conditionType: ConditionType.NotEqual),
            new RelationColumnInfo(
                parentKeyColumn: "Region",
                nestedKeyColumn: "Region"
                )})
    // ...
    .Build("Customers");
See Also