v.19.14Improvement
Add Setting Joined_subquery_requires_alias to Require Aliases for Subselects and Table Functions in FROM That More Than One Table Is Present (i.e
Add settingjoined_subquery_requires_aliasto require aliases for subselects and table functions inFROMthat more than one table is present (i.e. queries with JOINs). #6733 (Artem Zuikov)
Why it matters
This feature ensures clarity and avoids ambiguity in queries involving joins by requiring explicit aliases for subqueries and table functions in theFROM clause. It enhances query readability and prevents potential errors related to unnamed subqueries or table functions in multi-table joins.How to use it
Enable this feature by settingjoined_subquery_requires_alias to 1 in your session or globally. For example:SET joined_subquery_requires_alias = 1;This will enforce aliasing for all subselects and table functions used in joined queries.