| |
GeekInterview.com > Interview Questions > Oracle > SQL
| Print | |
| Question: What is difference between SUBSTR and INSTR?
Answer:
SUBSTR returns a specified portion of a string eg SUBSTR('BCDEF',4) output BCDE INSTR provides character position in which a pattern is found in a string. eg INSTR('ABC-DC-F','-',2) output 7 (2nd occurence of '-') |
| November 11, 2006 11:22:40 |
#3 |
| thumatinagaraju |
Member Since: Visitor Total Comments: N/A |
RE: What is difference between SUBSTR and INSTR?... |
| hisubstr i s used to select pirticular word frm stringsuppose select substr('nagaraju',1,3) from dual ;returns nag means 1 is start position of word and 3 is end ,,,ok instr returns only position of first occureence of a specified characterselect instr('nagaraju','a') from dual ;returns 2 only ;;ok i hope usatisfied with my answers |
| |
Back To Question | |