Use of the trim () function

Source: Internet
Author: User

In Oracle, the use of the trim () function has a leading beginning character, a trailing end character, a both beginning and a trailing character, as follows:

Trim (Leading | | trailing | | Both the character that will be replaced "from" the string to be replaced ")

1. Trim function to remove the specified opening character

Select Trim (Leading ' x ' from ' Xday ') as strtemp from TableName;

2. Trim function to remove specified end character

Select Trim (trailing ' x ' from ' Dayx ') as strtemp from TableName;

3. Trim function removes the specified header and trailing characters

Select Trim (both ' x ' from ' Xdayx ') as strtemp from TableName;

4, by default, the TRIM function will remove the header and tail, the specified character

Select Trim (' x ' from ' Xdayx ') as strtemp from TableName;

5. If the removed character is not specified, the header and trailing spaces are removed by default

Select Trim (' Day ') as strtemp from TableName;


Use of the trim () function

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.