Substring function in SQLServer

Source: Internet
Author: User
No details. No expression string, binary string, text, image, column, or expression containing the substring (expression, start, length) parameter is used when operating SQL Server. Do not use expressions that contain aggregate functions. Start integer or an expression that can be implicitly converted to int.

No details. No expression string, binary string, text, image, column, or expression containing the substring (expression, start, length) parameter is used when operating SQL Server. Do not use expressions that contain aggregate functions. Start integer or an expression that can be implicitly converted to int.

<无详细内容> <无>
When operating SQL Server, the substring function SUBSTRING (expression, start, length) parameter expression string, binary string, text, image, column, or expression containing column is used. Do not use expressions that contain aggregate functions. The start integer or expression that can be implicitly converted to int, which indicates the start position of the stator string. Length Integer or an expression that can be implicitly converted to int, which refers to the length of the stator string (but the result is supplemented with a length returned, it depends on the expression length and start Settings !!!!!!!!!!!). Return value if expression is a supported character data type, the returned character data. If expression is a supported binary data type, binary data is returned. If start is set to 1, the substring must be added from the first character of the expression. If it is set to 1, it starts from the first character and counts, 2, 3, 4 .... similarly, select substring (ziduan, 200908) selects the first six characters of the field. For example, if is set to 0, select substring (ziduan,) is also executed) the result will be 20090. If you change to-1 and execute select substring (ziduan,-2009), the result will be and-2, -3 ,................. result of following substring ('20170101',-98765): 9 substring ('20160901', 98765) Result: 98 substring ('20160901', 98765) Result: 987

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.