YAML -> SQL

YAML

    

main:
  with:
  - alias: cte_film
    from: film
    select: ["film_id", "title"]
  - from:
      values:
      - key: 1
        value: 4
      - key: 2
        value: 5
      - key: 3
        value: 6
    alias: cte1
    fields: ["temp_var1", "temp_var2"]
      
  select:
  - field: cte1.temp_var1
  - field: cte1.temp_var2
  - field: cte1.temp_var1 + cte1.temp_var2
    as: temp_var3
  - film_id
  - title
  - length
  from: cte_film
  where:
  - operator: =
    left: length      
    right: { value: 'Long' }

    

SQL

    
WITH "cte_film" AS (SELECT film_id, title FROM "film" "cte_film"), "cte1" AS (SELECT * FROM (VALUES (1, 4), (2, 5), (3, 6)) AS cte1(temp_var1, temp_var2)) SELECT cte1.temp_var1, cte1.temp_var2, cte1.temp_var1 + cte1.temp_var2 AS temp_var3, film_id, title, length FROM "cte_film" WHERE length = 'Long'