SUBSTR FUNCTION IN SQL WITH EXAMPLES QUERIES

Описание к видео SUBSTR FUNCTION IN SQL WITH EXAMPLES QUERIES

#SUBSTR,#FUNCTION,#ORACLE#oracle#substring#database #sqlinterviewquestionsandanswers
SUBSTR() Function
• Returns specified characters from Character value, Starting from a Specified Position ‘m’ to ‘N’ Characters Long.
• Used to Extract certain part of a given string/column data from a given position
Syntax: SUBSTR (COL/EXPR, m, n)
Or
Syntax: SUBSTR (string, start_position, end_position)
EXAMPLES:
1. SELECT SUBSTR ('ABCDEFG', 1 ,5) FROM DUAL; OUTPUT: ABCDE
2. SELECT SUBSTR ('ABCDEFG', 3 ,5) FROM DUAL; OUTPUT: CDEFG
3. SELECT SUBSTR ('ABCDEFG', -4 ,3) FROM DUAL; OUTPUT: DEF
4. SELECT SUBSTR ('ABCDEFG', -4) FROM DUAL; OUTPUT: DEFG
5. SELECT SUBSTR ('ABCDEFG', 3,0) FROM DUAL; OUTPUT: NULL
6. SELECT SUBSTR ('ABCDEFG', 1) FROM DUAL; OUTPUT: ABCDEFG
6.SELECT ENAME, SUBSTR(ENAME ,3) FROM EMP;

Комментарии

Информация по комментариям в разработке