日期:2014-05-17 浏览次数:20413 次
string viewScript = " left join (select T1 as T2 from Table group by T1 ) as t on t (select 1 from TT) as c"; viewScript = Regex.Replace(viewScript, @"(?i)as ", "");
------解决方案--------------------
string viewScript = " left join (select T1 as T2 from Table group by T1 ) as t on t (select 1 from TT) as c"; viewScript = Regex.Replace(viewScript,@"(?<=join\s*?\([^)]+?\).*?)\s+as\s+"," "); // left join (select T1 as T2 from Table group by T1 ) t on t (select 1 from TT) c
------解决方案--------------------
string source = "left join (select T1 as T2 from Table group by T1 ) as t on t (select 1 from TT) as c"; Regex reg = new Regex(@"(?<=\([^\)]*?\) )as"); source = reg.Replace(source, @"");
------解决方案--------------------
string sql=@"string viewScript = "" left join (select T1 as T2 from Table group by T1 ) as t on t (select 1 from TT) as c"; sql= Regex.Replace(sql, @"(?<=\)\s+)as", "");