栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

SelectParser:一个实现从sql语句中提取表名的强大工具

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

SelectParser:一个实现从sql语句中提取表名的强大工具

SelectParser 简介:一个从sql语句中提取表名的工具 图片:

Features

支持标准sql
深度支持oracle sql

用法

1.启动程序
方式一(需要安装python):命令启动:python main.py
方式二(无须python,推荐):点击exe文件运行,exe文件获取方式:
QQ群: 788719152
Email:2577154121@qq.com
微信号:x9527bo
2.选择
选择输入目录。输出文件
3.点击开始

示例
with tmp_table1 as( 
select 
a.id as id, 
b.name as name, -- from 
c.city,
' from 
aa',
--select * from comment_table1 a join comment_table2 b on a.id = b.id where 1=1
66
,
(select a.name from country a where a.id = c.countryid) as country,
'---',
(select nvl(c.country,' ') from dual as a) as country1,
a.amount,
decode(d.email,'xxx',' select ',nvl(e.name,' from ')),
'a
aa' name1,
' where ' as  test
from order as a 
left join user1. customer b on (a.custid = b.id)  and b.sex in ('0','1','2')
join address c on c.id = b.addressid
left join (select custid, max(email) email from contact a where email is not null group by custid) d on d.custid =b.id,
company e
where e.id = b.companyid
union all
select 
*
from (select * from order as b) as a ,(select * from customer as b) b --,comment_table3
, address c 
,(select custid, max(email) email from contact a where email is not null group by custid) d 
where a.id = (select 1 from dual)
and b.custid = subsrr(b.id,1,8)
and b.addressid = c.id
and d.custid = b.id
),
tmp_table2 AS
(
select * from (select * from user1 . order a join user2.customer b on a.custid = b.id)
)
select a.custid, sum(amount) from tmp_table1 a, tmp_table2 b 
where a.id = b.id
and a.id exists(select * from order c where c.amout >= 10000 )
and b.date >= add_months((select sysdate from dual),-12)
group by a.custid

结果:

demo.sql,country
demo.sql,dual
demo.sql,order
demo.sql,user1.customer
demo.sql,address
demo.sql,contact
demo.sql,company
demo.sql,order
demo.sql,customer
demo.sql,address
demo.sql,contact
demo.sql,dual
demo.sql,user1.order
demo.sql,user2.customer
demo.sql,order
demo.sql,dual

Author: ryjfgjl 如需帮助,请加qq群 788719152
转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/856169.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号