You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you define a new column in a subquery and do a join the new column can't be referenced by the containing query. A "does not exist" error is returned.
An example:
CREATETABLEusers (
user_id INTPRIMARY KEY
);
CREATETABLEnames (
user_id INTREFERENCES users,
first_name TEXT,
last_name TEXT
);
SELECT
user_id,
full_name
FROM users
JOIN (
SELECT
user_id,
first_name || last_name AS full_name
FROM names
) AS full_names USING (user_id);
Returns column "full_name" does not exist, though the query is valid.
Activity
[-]Columns Not Found When Joining Subquery[/-][+]Columns not found when joining subquery[/+]parser: Support columns from subselect statements
parser: Support columns from subselect statements
parser: Support columns from subselect statements
parser: Support columns from subselect statements (#489)