SQL Server Basics

Source: Internet
Author: User

A
1.
1 LTRIM (character_expression)-- Delete the starting space in the character variable 2 RTRIM ( character_expression)-- Delete trailing spaces in the character variable

2. Gets the start position of the returned start of the specified string. Return position starting from 1, not starting from 0

1 CHARINDEX (expression1, expression2 [ , Start_location ] )


(ii) SUBSTRING (expression, start, length) parameter expression is a string, a binary string, a text, an image, a column, or a containing column. Do not use an expression that contains an aggregate function. Start is an integer that specifies the starting position of the substring. Length is an integer that specifies the length of the substring (the number of characters or bytes to return). SELECT x = SUBSTRING ('abcdef', 2, 3) Here is the result set: X----------BCD

SQL Server Basics

Related Article

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.