This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
dev:sql:functions:trim [2010/07/09 03:30] els |
dev:sql:functions:trim [2016/06/28 22:38] (current) |
||
---|---|---|---|
Line 5: | Line 5: | ||
The TRIM function removes any leading and/or trailing pad characters from a string. The pad character is a single character and defaults to a space character. | The TRIM function removes any leading and/or trailing pad characters from a string. The pad character is a single character and defaults to a space character. | ||
- | This function returns a C STRING datatype. | + | This function returns a STRING datatype. |
===== Syntax ===== | ===== Syntax ===== | ||
Line 26: | Line 26: | ||
===== Examples ===== | ===== Examples ===== | ||
- | ==== Example 1 ==== | + | ==== Example 1: Column ==== |
<code> | <code> | ||
> select trim(name) from individuals; | > select trim(name) from individuals; | ||
Line 40: | Line 40: | ||
KATHLEEN TUCKER | KATHLEEN TUCKER | ||
</code> | </code> | ||
- | ==== Example 2 ==== | + | ==== Example 2: Column with LEADING ==== |
<code> | <code> | ||
Line 55: | Line 55: | ||
000900240828 900240828 | 000900240828 900240828 | ||
</code> | </code> | ||
- | ==== Example 3 ==== | + | ==== Example 3: Complex expression ==== |
The following complex example creates a string containing the name and an optional email. | The following complex example creates a string containing the name and an optional email. | ||
Line 81: | Line 81: | ||
Kathleen Tucker | Kathleen Tucker | ||
</code> | </code> | ||
+ | ====== Additional Resources ====== | ||
+ | |||
+ | See also: | ||
+ | {{page>dev:sql:functions:see_also_string&nofooter&noeditbtn&noheader}} | ||
+ | |||
{{page>:bottom_add&nofooter&noeditbtn}} | {{page>:bottom_add&nofooter&noeditbtn}} | ||