-
Notifications
You must be signed in to change notification settings - Fork 7
feature_07_join_tables
여러 테이블의 레코드를 조합하여 하나의 열로 표현하는 Join 문과 관련된 기능을 제공합니다.
✔ = 지원하는 기능
❌ = 지원하지 않는 기능
⚠ = 지원 예정
Feature | MySql | PostgreSql | JSql | Oracle | SqlServer |
---|---|---|---|---|---|
Join Tables | ✔ | ✔ | ✔ | ✔ | ✔ |
Join Tables (Pivot Columns) | ✔ | ✔ | ✔ | ✔ | ❌ |
SELECT * FROM left_table l JOIN right_table r ON l.uid = r.uid
Database.Table = sample_db
.left_table
Columns = name, uid
Database.Table = sample_db
.right_table
Columns = age, uid
-
IQsiDerivedTableNode
-
Columns
-
Source
-
IQsiJoinedTableNode
-
Left
-
IQsiDerivedTableNode
-
Columns
-
Source
-
IQsiTableAccessNode
-
Identifier
=left_table
-
-
IQsiTableAccessNode
-
Alias
-
IQsiAliasNode
-
Name
=l
-
-
IQsiAliasNode
-
-
IQsiDerivedTableNode
-
JoinType
=Inner
-
Right
-
IQsiDerivedTableNode
-
Columns
-
Source
-
IQsiTableAccessNode
-
Identifier
=right_table
-
-
IQsiTableAccessNode
-
Alias
-
IQsiAliasNode
-
Name
=r
-
-
IQsiAliasNode
-
-
IQsiDerivedTableNode
-
-
IQsiJoinedTableNode
-
-
name (derived)
-
name (join)
-
name (derived: l)
-
name
- Reference : sample_db.left_table
-
name
-
name (derived: l)
-
name (join)
-
uid (derived)
-
uid (join)
-
uid (derived: l)
-
uid
- Reference : sample_db.left_table
-
uid
-
uid (derived: l)
-
uid (join)
-
age (derived)
-
age (join)
-
age (derived: r)
-
age
- Reference : sample_db.right_table
-
age
-
age (derived: r)
-
age (join)
-
uid (derived)
-
uid (join)
-
uid (derived: r)
-
uid
- Reference : sample_db.right_table
-
uid
-
uid (derived: r)
-
uid (join)
해당 쿼리에서는 left_table과 right_table을 서로 Join 합니다.
left_table과 right_table에 name
, uid
, age
, uid
로 총 4개의 Column이 있으므로 총 4개의 Column이 추적되며 left_table과 right_table에서 같은 이름인 uid 컬럼이 있지만, 마지막까지 추적하여 Reference를 확인하면 left_table과 right_table 모두 정상적으로 추적됩니다.
SELECT * FROM left_table JOIN right_table USING ( uid )
Database.Table = sample_db
.left_table
Columns = name, uid
Database.Table = sample_db
.right_table
Columns = age, uid
-
IQsiDerivedTableNode
-
Columns
-
Source
-
IQsiJoinedTableNode
-
Left
-
IQsiTableAccessNode
-
Identifier
=left_table
-
-
IQsiTableAccessNode
-
JoinType
=Inner
-
Right
-
IQsiTableAccessNode
-
Identifier
=right_table
-
-
IQsiTableAccessNode
-
PivotColumns
-
IQsiColumnsDeclarationNode
-
Columns
-
IQsiDeclaredColumnNode
-
Name
=uid
-
-
IQsiDeclaredColumnNode
-
-
IQsiColumnsDeclarationNode
-
-
IQsiJoinedTableNode
-
-
uid (derived)
-
uid (join)
- Reference : sample_db.left_table
- Reference : sample_db.right_table
-
uid (join)
-
name (derived)
-
name (join)
- Reference : sample_db.left_table
-
name (join)
-
age (derived)
-
age (join)
- Reference : sample_db.right_table
-
age (join)
left_table
에는 uid
랑 name
컬럼이 있고 right_table
에는 uid
랑 age
컬럼이 있습니다.
두개의 테이블을 묶을때 uid
컬럼을 기준으로 묶게 되므로 uid
컬럼에는 left_table
과 right_table
총 2개의 테이블의 레퍼런스를 가지고 있습니다.
SELECT * from left_table, right_table
Database.Table = sample_db
.left_table
Columns = name, uid
Database.Table = sample_db
.right_table
Columns = age, uid
-
IQsiDerivedTableNode
-
Columns
-
Source
-
IQsiJoinedTableNode
-
Left
-
IQsiDerivedTableNode
-
Columns
-
Source
-
IQsiTableAccessNode
-
Identifier
=left_table
-
-
IQsiTableAccessNode
-
-
IQsiDerivedTableNode
-
JoinType
=Full
-
Right
-
IQsiDerivedTableNode
-
Columns
-
Source
-
IQsiTableAccessNode
-
Identifier
=right_table
-
-
IQsiTableAccessNode
-
-
IQsiDerivedTableNode
-
-
IQsiJoinedTableNode
-
-
name (derived)
-
name (join)
-
name (derived)
-
name
- Reference : sample_db.left_table
-
name
-
name (derived)
-
name (join)
-
uid (derived)
-
uid (join)
-
uid (derived)
-
uid
- Reference : sample_db.left_table
-
uid
-
uid (derived)
-
uid (join)
-
age (derived)
-
age (join)
-
age (derived)
-
age
- Reference : sample_db.right_table
-
age
-
age (derived)
-
age (join)
-
uid (derived)
-
uid (join)
-
uid (derived)
-
uid
- Reference : sample_db.right_table
-
uid
-
uid (derived)
-
uid (join)