Skip to content

Complete SELECT output aliases in ORDER BY and HAVING #1

Closed

Description

@canyrtcn

Local SQL completion does not recognize output aliases declared by the current SELECT when writing ORDER BY or HAVING.

For example, with an orders table containing an amount column:

SELECT SUM(amount) AS total_revenue
FROM orders
ORDER BY tot

The editor should offer total_revenue at the end of tot. The same alias should be available in HAVING, while aliases from other statements, nested SELECTs and CTEs must not leak into the current scope.

This concerns local editor suggestions only; query execution does not need to change.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions