Skip to content

Fix VALUES and column aliases in CTEs#188

Merged
georgestagg merged 2 commits intomainfrom
fix-column-aliases
Mar 12, 2026
Merged

Fix VALUES and column aliases in CTEs#188
georgestagg merged 2 commits intomainfrom
fix-column-aliases

Conversation

@georgestagg
Copy link
Collaborator

Allows for queries of the form,

WITH t(value, label) AS (
    SELECT * FROM (VALUES
        (70, 'Target'),
        (80, 'Warning'),
        (90, 'Critical')
    )
)
SELECT Date AS date, temp AS temperature
FROM ggsql:airquality
WHERE Month = 5

VISUALISE 
  DRAW line MAPPING date AS x, temperature AS y
  DRAW rule MAPPING value AS y, label AS colour FROM t

which are useful in sqlite.

@georgestagg georgestagg requested a review from thomasp85 March 11, 2026 14:13
Copy link
Collaborator

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - we are however venturing into SQL territory that I rarely visit

@georgestagg georgestagg merged commit 06f532f into main Mar 12, 2026
30 checks passed
@georgestagg georgestagg deleted the fix-column-aliases branch March 12, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants