diff options
Diffstat (limited to 'sqlglot/optimizer/expand_multi_table_selects.py')
-rw-r--r-- | sqlglot/optimizer/expand_multi_table_selects.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sqlglot/optimizer/expand_multi_table_selects.py b/sqlglot/optimizer/expand_multi_table_selects.py index ba562df..86f0c2d 100644 --- a/sqlglot/optimizer/expand_multi_table_selects.py +++ b/sqlglot/optimizer/expand_multi_table_selects.py @@ -2,6 +2,14 @@ from sqlglot import exp def expand_multi_table_selects(expression): + """ + Replace multiple FROM expressions with JOINs. + + Example: + >>> from sqlglot import parse_one + >>> expand_multi_table_selects(parse_one("SELECT * FROM x, y")).sql() + 'SELECT * FROM x CROSS JOIN y' + """ for from_ in expression.find_all(exp.From): parent = from_.parent |