Date post: | 11-Apr-2016 |
Category: |
Documents |
Upload: | vaibhavgupta |
View: | 221 times |
Download: | 2 times |
Example:The following example return several substrings of string "THIS IS A FEATURED ARTICLE"
SELECT SUBSTR('THIS IS A FEATURED ARTICLE', 11, 8) FROM DUAL;OUTPUT : FEATURED
SELECT SUBSTR('THIS IS A FEATURED ARTICLE', -7, 7) FROM DUAL;OUTPUT : ARTICLE
SELECT SUBSTR('THIS IS A FEATURED ARTICLE', 11) FROM DUAL;OUTPUT : FEATURED ARTICLE
SELECT TRIM(' HELLO ');
Result: 'HELLO'
SELECT LTRIM(' HELLO ');
Result: 'HELLO '
SELECT RTRIM(' HELLO ');
Result: ' HELLO'
SELECT TRIM (0 FROM 0009872348900) FROM DUAL;
98723489
SELECT TRIM (‘ this is a test. ') from dual;
this is a test.
SELECT TRIM('x' FROM 'xxxxthis is a test.xxxx') from dual;
this is a test.
TRUNC(125.815)Result: 125
TRUNC(125.815, 0)Result: 125
TRUNC(125.815, 1)Result: 125.8
TRUNC(125.815, 2)Result: 125.81
TRUNC(125.815, 3)Result: 125.815
TRUNC(-125.815, 2)Result: -125.81
TRUNC(125.815, -1)Result: 120
TRUNC(125.815, -2)Result: 100
TRUNC(125.815, -3)Result: 0