Skip to main content
This parameter specifies the SQL condition that determines how rows from the source view and joined view are matched together. It supports simple equality joins as well as complex join conditions.

Syntax

on_sql: <sql_join_condition>

Properties

on_sql
string
required
The SQL condition for matching rows between views. Use ${view_name.field_name} syntax to reference fields.
When using aliased joins, both the original view names (join_from_view, join_to_view) and aliased view names (join_from_view_as, join_to_view_as) can be used in this parameter.

Examples

Basic equality join
- join_from_view: buyers
  join_to_view: user_facts
  join_to_view_as: buyer_facts
  join_type: always_left
  on_sql: ${buyers.id} = ${buyer_facts.id}
  relationship_type: one_to_one
Complex inequality join
- join_from_view: table_1
  join_to_view: table_2
  join_type: always_left
  on_sql: ${table_1.id} > ${table_2.id}
Compound join keys
- join_from_view: table_1
  join_to_view: table_2
  join_type: always_left
  on_sql: ${table_1.key_1} = ${table_2.key_1} AND ${table_1.key_2} = ${table_2.key_2}