What is difference between SUBSTR and INSTR in the SQL?

 Posted by Tripati_tutu on 11/17/2010 | Category: Sql Server Interview questions | Views: 5818 | Points: 40

The SUBSTR function returns a specific portion of a string
Example: SUBSTR('DotNetFunda',6)
The result will be: DotNet

The INSTR function provides character position in a pattern of string.
Example: INSTR('Dot-Net-Funda','-',2)
The result will be: 8 (2nd occurrence of '-')

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response