Skip to content

SQL Auto-completion Does Not Work for Aliases from Derived Tables #1697

Closed

Description

@gkjoyes

What happened?

Description

When writing a query that joins a derived table (subquery) with an alias, auto-completion does not suggest columns for the derived table alias.

For example, in the query below, auto-completion works for hs.* but not for ahs.*.

Reproduction Query

SELECT YEAR,
       hs.country,
       happiness_score,
       ahs.avg_happiness_score
FROM happiness_scores hs
LEFT JOIN (
  SELECT country,
         AVG(happiness_score) AS avg_happiness_score
  FROM happiness_scores
  GROUP BY country
) ahs
  ON hs.country = ahs.country;

Expected Behavior

Auto-completion should recognize the derived table alias ahs and suggest:

  • country
  • avg_happiness_score

Database type

MySQL / MariaDB

TablePro version

0.51.1

macOS version & chip

macOS 26.5

Screenshots / Logs

No response

Activity

  1. added
    bug
    on Jun 16, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions