sql去除注释

2021/8/16 19:36:15

本文主要是介绍sql去除注释,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

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去除注释的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程