Data Archive
- Data Archive 6.4.3 HotFix 1
- All Products
SUBSTRING ( char value-expression, integer start-position [, integer length ] ) SUBSTRING ( char value-expression FROM integer start-position [ FOR integer length ] ) SUBSTR ( char value-expression, integer start-position [, integer length ] ) SUBSTR ( char value-expression FROM integer start-position [ FOR integer length ] )
|
|
---|---|
|
|
|
|
|
|
CREATE TABLE string_table (col1 SMALLINT, col2 VARCHAR(20)); INSERT INTO string_table VALUES (1, '12345'); 1 row affected INSERT INTO string_table VALUES (2, 'PK1-H4V1Y9-QC'); 1 row affected INSERT INTO string_table VALUES (3, '514-939-3477'); 1 row affected SELECT SUBSTR(col2, 2, 2) FROM string_table WHERE col1=1; 1 row selected 1 -- 23 SELECT SUBSTRING(col2 FROM 5 FOR 6) FROM string_table WHERE col1=2; 1 row selected 1 ------ H4V1Y9 SELECT SUBSTR(col2, 5) FROM string_table WHERE col1=3; 1 row selected 1 ---------------- 939-3477