如何找到最后一次出现的','在使用RegEx
的c#中的字符串中我试过下面的代码
string ss = Regex.Replace(strQuery, @"/\,(?<firstMatch>.*)=case(?<secondMatch>.*end\b)", @" case ${secondMatch} ""${firstMatch}"" ", RegexOptions.IgnoreCase);
输入
SELECT * FROM (select TOP 5 ROW_NUMBER() OVER (ORDER BY Region_desc) as ROW_NUM,* from (select *, ROW_NUMBER() over (order by Region_desc desc) as gridviewcount from( SELECT BO_REGION_MASTER.Region_ID,BO_REGION_MASTER.Region_CODE,BO_REGION_MASTER.Region_DESC,STATUS=CASE WHEN BO_REGION_MASTER.STATUS='A' THEN 'ACTIVE' WHEN BO_REGION_MASTER.STATUS='I' THEN 'INACTIVE' ELSE '' END,
我正在获得输出
SELECT * FROM (select TOP 5 ROW_NUMBER() OVER (ORDER BY Region_desc) as ROW_NUM,* from (select *, ROW_NUMBER() over (order by Region_desc desc) as gridviewcount from( SELECT BO_REGION_MASTER.Region_ID,BO_REGION_MASTER.Region_CODE,BO_REGION_MASTER.Region_DESC,STATUS=CASE WHEN BO_REGION_MASTER.STATUS='A' THEN 'ACTIVE' WHEN BO_REGION_MASTER.STATUS='I' THEN 'INACTIVE' ELSE '' END,
但我需要输出如下
SELECT * FROM (select TOP 5 ROW_NUMBER() OVER (ORDER BY Region_desc) as ROW_NUM,* from (select *, ROW_NUMBER() over (order by Region_desc desc) as gridviewcount from( SELECT BO_REGION_MASTER.Region_ID,BO_REGION_MASTER.Region_CODE,BO_REGION_MASTER.Region_DESC,CASE WHEN BO_REGION_MASTER.STATUS='A' THEN 'ACTIVE' WHEN BO_REGION_MASTER.STATUS='I' THEN 'INACTIVE' ELSE '' END "STATUS",
答案 0 :(得分:0)