ICode9

精准搜索请尝试: 精确搜索
首页 > 数据库> 文章详细

sql去除注释

2021-08-16 16:35:10  阅读:91  来源: 互联网

标签:-- sql 注释 report 去除 employee organization id


https://www.shangmayuan.com/a/39a8fba001d84c168f35488e.html

 

该方法,能在保持原有代码的状况下,好比大小写,换行,缩进等信息,去除sql中的各类注释
代码以下web

Pattern p = Pattern.compile("(?ms)('(?:''|[^'])*')|--.*?$|/\\*.*?\\*/|#.*?$|");
String presult = p.matcher(sql).replaceAll("$1");
return presult;

包括sql

横杠注释ruby

  --drop table report.rpt_employee_fund_match;
--create table report.rpt_employee_fund_match as 
/*  insert into report.partner_open_account_stat_tmp
  -- where to_number(to_char(a.create_date,'YYYYMMDD'),'99999999') <= v_period_id
*/ -- delete by zak 20140623

包括不去掉原有代码里面的注释,很是强大svg

select employee_id, max(cast(organization_id as integer)) 
organization_id 
from src_ht_hr_ims.ims_rt_employee_organization where state=1
and jobtitle <>'--' --and employee_id='50019940'
group by employee_id                     

标签:--,sql,注释,report,去除,employee,organization,id
来源: https://www.cnblogs.com/xuxm2007/p/15148462.html

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有