Step by Step -104-sql statement (Intercept string)

Source: Internet
Author: User
Tags rtrim

Intercepts a string by the specified character and intercepts 300

Business requirements: Want to match the frame line part of the picture

First step from last/intercept to end

Select top 1 reverse (substring (reverse (processcontrolname), 1,charindex ('/', reverse (processcontrolname))-1) from Processpublish;

--The second step is based on the first step from the last one. Intercept
Select RTRIM (LTRIM (Reverse (substring (reverse), processcontrolname ('/', 1,charindex (reverse))-1 )))) as Web-side templates, RTRIM (LTRIM (Reverse (substring (reverse), Mobileformtemplatepath ('/', 1,charindex ( Mobileformtemplatepath)))))) as a mobile-phone template, *
From Processpublish
where ProcessID >2489--The newly added "Hua Ji construction"
and processcontrolname! = "--the template is not equal to NULL, stating that BPM originated
and Mobileformtemplatepath! = "'

--The third step is to get rid of it on the basis of the second step. HTML fields
Select top 1 (SUBSTRING (substring (reverse (processcontrolname), charindex ('. ', reverse (processcontrolname)) +1,len ( Reverse (Processcontrolname))-charindex ('. ', reverse (processcontrolname))), 1,charindex ('/', (SUBSTRING (reverse ( Processcontrolname), CHARINDEX ('. ', reverse (processcontrolname)) +1,len (reverse (processcontrolname))-charindex ('. ') , reverse (Processcontrolname))))-1) from Processpublish

Finally, complete

Select (SUBSTRING (substring (reverse (processcontrolname), charindex ('. ', reverse (processcontrolname)) +1,len ( Reverse (Processcontrolname))-charindex ('. ', reverse (processcontrolname))), 1,charindex ('/', (SUBSTRING (reverse ( Processcontrolname), CHARINDEX ('. ', reverse (processcontrolname)) +1,len (reverse (processcontrolname))-charindex ('. ') , reverse (Processcontrolname))))-1) as web-side templates,
(SUBSTRING (substring (reverse (mobileformtemplatepath), charindex ('. ', reverse (Mobileformtemplatepath)) +1,len ( Reverse (Mobileformtemplatepath))-charindex ('. ', reverse (Mobileformtemplatepath))), 1,charindex ('/', (substring ( Reverse (Mobileformtemplatepath), charindex ('. ', reverse (Mobileformtemplatepath)) +1,len (Reverse ( Mobileformtemplatepath))-charindex ('. ', reverse (Mobileformtemplatepath)))))))) (1)) as mobile-side template, *
From Processpublish
where ProcessID >2489--The newly added "Hua Ji construction"
and processcontrolname! = "--the template is not equal to NULL, stating that BPM originated
and Mobileformtemplatepath! = "'
and (SUBSTRING (substring (reverse (processcontrolname), charindex ('. ', reverse (processcontrolname)) +1,len (Reverse ( Processcontrolname))-charindex ('. ', reverse (processcontrolname))), 1,charindex ('/', (SUBSTRING (reverse ( Processcontrolname), CHARINDEX ('. ', reverse (processcontrolname)) +1,len (reverse (processcontrolname))-charindex ('. ') , reverse (Processcontrolname)))) (1))! = (substring (substring (reverse), Mobileformtemplatepath ('. ', Reverse (Mobileformtemplatepath)) +1,len (reverse (Mobileformtemplatepath))-charindex ('. ', Reverse ( Mobileformtemplatepath))), 1,charindex ('/', (substring (reverse (mobileformtemplatepath), charindex ('. '), Reverse ( Mobileformtemplatepath) +1,len (reverse (Mobileformtemplatepath))-charindex ('. ', reverse (Mobileformtemplatepath)) )))-1))

Three inconsistencies were found.

Step-by-step -104-sql statement (Intercept string)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.