没有合适的资源?快使用搜索试试~ 我知道了~
利用正则表达式对SQL解释的方法
4星 · 超过85%的资源 需积分: 10 23 下载量 199 浏览量
2009-03-30
23:37:38
上传
评论
收藏 11KB TXT 举报
温馨提示
试读
22页
一种通过正则表达式进行SQL解释的方法.举例说明他的用法.分析源码等等
资源推荐
资源详情
资源评论
一种通过正则表达式进行SQL解释的方法
先看要解析的样例SQL语句:
select * from dual
SELECT * frOm dual
Select C1,c2 From tb
select c1,c2 from tb
select count(*) from t1
select c1,c2,c3 from t1 where condi1=1
Select c1,c2,c3 From t1 Where condi1=1
select c1,c2,c3 from t1,t2 where condi3=3 or condi4=5 order by o1,o2
Select c1,c2,c3 from t1,t2 Where condi3=3 or condi4=5 Order by o1,o2
select c1,c2,c3 from t1,t2,t3 where condi1=5 and condi6=6 or condi7=7 group by g1,g2
Select c1,c2,c3 From t1,t2,t3 Where condi1=5 and condi6=6 or condi7=7 Group by g1,g2
Select c1,c2,c3 From t1,t2,t3 Where condi1=5 and condi6=6 or condi7=7 Group by g1,g2,g3 order by g2,g3
解析效果之一(isSingleLine=false):
原SQL为select * from dual
解析后的SQL为
select
*
from
dual
原SQL为SELECT * frOm dual
解析后的SQL为
select
先看要解析的样例SQL语句:
select * from dual
SELECT * frOm dual
Select C1,c2 From tb
select c1,c2 from tb
select count(*) from t1
select c1,c2,c3 from t1 where condi1=1
Select c1,c2,c3 From t1 Where condi1=1
select c1,c2,c3 from t1,t2 where condi3=3 or condi4=5 order by o1,o2
Select c1,c2,c3 from t1,t2 Where condi3=3 or condi4=5 Order by o1,o2
select c1,c2,c3 from t1,t2,t3 where condi1=5 and condi6=6 or condi7=7 group by g1,g2
Select c1,c2,c3 From t1,t2,t3 Where condi1=5 and condi6=6 or condi7=7 Group by g1,g2
Select c1,c2,c3 From t1,t2,t3 Where condi1=5 and condi6=6 or condi7=7 Group by g1,g2,g3 order by g2,g3
解析效果之一(isSingleLine=false):
原SQL为select * from dual
解析后的SQL为
select
*
from
dual
原SQL为SELECT * frOm dual
解析后的SQL为
select
*
from
dual
原SQL为Select C1,c2 From tb
解析后的SQL为
select
C1,c2
from
tb
原SQL为select c1,c2 from tb
解析后的SQL为
select
c1,c2
from
tb
原SQL为select count(*) from t1
解析后的SQL为
select
count(*)
from
t1
原SQL为select c1,c2,c3 from t1 where condi1=1
解析后的SQL为
select
c1,c2,c3
from
from
dual
原SQL为Select C1,c2 From tb
解析后的SQL为
select
C1,c2
from
tb
原SQL为select c1,c2 from tb
解析后的SQL为
select
c1,c2
from
tb
原SQL为select count(*) from t1
解析后的SQL为
select
count(*)
from
t1
原SQL为select c1,c2,c3 from t1 where condi1=1
解析后的SQL为
select
c1,c2,c3
from
剩余21页未读,继续阅读
资源评论
- cm_1272012-07-26以前没接触过正则表达式,感觉收获很大,不错的入门级教程
zxl19890103
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功