-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: [lab3] support table alias in join clause (#14)
目前代码不支持 `JOIN` 子句中使用表别名,涉及多表连接时不方便书写 SQL 语句。考虑扩充 SQL 解析的文法,在 `join_list` 支持形如 `table_name table_alias` 或 `table_name AS table_alias` 的语法,同时重构文法中对表别名的处理方式,提升代码复用性。 修改后,连接操作的 SQL 可以使用别名简化,例如 ```sql SELECT * FROM join_table_1 a INNER JOIN join_table_2 b ON b.id = a.id INNER JOIN join_table_3 c ON c.id = b.id WHERE a.name = 'a'; ``` 同时也更方便进行 self-join,例如 ```sql SELECT * FROM join_table_1 a INNER JOIN join_table_1 b ON b.id = a.id + 1; ```
- Loading branch information
1 parent
a43bd5f
commit 1cfb3b5
Showing
9 changed files
with
635 additions
and
718 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.