Skip to content

feature_03_derived_table

Tony Jang edited this page Oct 5, 2020 · 2 revisions

Feature: Derived Table

파생된 테이블과 관련된 기능입니다.

Supported Language

✔ = 지원하는 기능
❌ = 지원하지 않는 기능
⚠ = 지원 예정

Feature MySql PostgreSql JSql Oracle SqlServer
Derived Table (w/ Alias)
Derived Table (w/o Alias)

Case 1. Derived Table with Alias

Example Query

SELECT * FROM (SELECT * FROM sample_table) AS alias

Database


Database.Table = sample_db.sample_table

Columns = sample_column1, sample_column2


Expected QSI Tree

Analyze Result

  • sample_column1 (derived)

    • sample_column1 (derived: alias)
      • sample_column1 (table: sample_db.sample_table)
        • Reference : sample_db.sample_table
  • sample_column2 (derived)

    • sample_column2 (derived: alias)
      • sample_column2 (table: sample_db.sample_table)
        • Reference : sample_db.sample_table

위와 같은 쿼리 결과에서 SELECT 절 이후 SELECT * FROM sample_table 서브 쿼리를 DerivedTable로 처리해 결과를 추적합니다. 이때 해당 서브쿼리는 별칭이 적용되었으므로 alias라는 별칭으로 추적됩니다.

Case 2. Derived Table without Alias

Example Query

SELECT * FROM (SELECT * FROM sample_table)

Database

Database.Table = sample_db.sample_table

Columns = sample_column1, sample_column2

Expected QSI Tree

Analyze Result

  • sample_column1 (derived)

    • sample_column1 (derived)
      • sample_column1 (table: sample_db.sample_table)
        • Reference : sample_db.sample_table
  • sample_column2 (derived)

    • sample_column2 (derived)
      • sample_column2 (table: sample_db.sample_table)
        • Reference : sample_db.sample_table

위와 같은 쿼리 결과에서 SELECT 절 이후 SELECT * FROM sample_table 서브 쿼리를 DerivedTable로 처리해 결과를 추적합니다.

Clone this wiki locally