SQL解析器识别SQL内部使用的表
我正在寻找一种解决方案,以识别SQL查询中使用的表列表。我可以使用Unix Shell脚本找到表名。但是要确定哪个表是强制性的(内联节表)&不是(左连接表) - 基本的外壳脚本没有太大帮助,因为复杂的SQL场景太多(嵌套子查询,左JOIN 关键字之后是子查询具有内在的联接)。
有任何指示可以达到要求吗?
I am looking for a solution to identify list of tables used in a SQL query. I am able to find the table names using Unix shell scripting. but to identify which table is mandatory (inner join tables) & which are not (left join tables) - basic shell scripting is not helping much as there are too many complex SQL scenario (Nested subquery , left join keyword is followed by a subquery which has inner join ).
any pointers to achieve the requirement ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 sqlglot
从那里,您将获得所有表节点的列表检查父母以查看是否符合您的条件。
You can use SQLGlot
From there, you'll get a list of all the table nodes which you can then check the parent to see if it fits your criteria.