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