Trim functions in oracle

Source: Internet
Author: User

The trim function in oracle is used to delete the given characters in the header or tail of a given string or given number. The trim function has the following form: www.2cto.com trim ([leading/trailing/both] [matching string or value] [from] [string or value to be processed]) here, if leading indicates that the string matches the header is deleted, if trailing indicates that the string matches the tail is deleted, if both is specified, or no position is specified, both ends are deleted. If no matching string or value is specified, it is considered as a space, that is, the leading or trailing space is deleted. The type returned by the trim function is varchar2. Below are some examples: Two 0 SQL statements after the number 7500 are truncated> select trim (0 from 7500) from dual; TRIM -- 75 the following example captures the 'SQL> select trim ('medium' from 'mid-autumn mid-October mid-20') as poem from dual; poetry ------ the example below in autumn August captures the 'half 'text SQL> select trim (leading 'half' from 'half half in the middle of the night ') in front of 'half half in the middle of the night ') as poetry from dual; poetry -------- night two more half

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.