📅  最后修改于: 2020-11-29 08:58:39             🧑  作者: Mango
Teradata提供了几种操作字符串的功能。这些功能与ANSI标准兼容。
Sr.No | String Function & Description |
---|---|
1 |
|| Concatenates strings together |
2 |
SUBSTR Extracts a portion of a string (Teradata extension) |
3 |
SUBSTRING Extracts a portion of a string (ANSI standard) |
4 |
INDEX Locates the position of a character in a string (Teradata extension) |
5 |
POSITION Locates the position of a character in a string (ANSI standard) |
6 |
TRIM Trims blanks from a string |
7 |
UPPER Converts a string to uppercase |
8 |
LOWER Converts a string to lowercase |
下表列出了一些字符串函数及其结果。
String Function | Result |
---|---|
SELECT SUBSTRING(‘warehouse’ FROM 1 FOR 4) | ware |
SELECT SUBSTR(‘warehouse’,1,4) | ware |
SELECT ‘data’ || ‘ ‘ || ‘warehouse’ | data warehouse |
SELECT UPPER(‘data’) | DATA |
SELECT LOWER(‘DATA’) | data |