Difference between SUBSTR and INSTR?
Answers were Sorted based on User's Feedback
Answer / tulsi
SUBSTR is used to extract a set of characters from a string
by specificing the character starting position and end
position and length of characters to be fetched.
example substr('hello',2,3) will return 'ell'
INSTR is used to find the position of any particular
character in a word which returns numeric value.
instr('hello','e') - will return the position of 'e' as 2
| Is This Answer Correct ? | 65 Yes | 6 No |
Answer / shrikant
Hi,
Yes Tulsi is right.
Execute the below queries & you will see the diff clearly -
SELECT instr('hello','e') FROM dual
SELECT substr('hello',2,3) FROM dual
| Is This Answer Correct ? | 34 Yes | 4 No |
Answer / atchala ramanareddy
substr:
select substr('atchala ramanareddy',2,9) from dual;
it will return tchala ra.
instr:
select instr('atchala ramanareddy','a',1,2) from dual;
it will return 5.
| Is This Answer Correct ? | 19 Yes | 3 No |
How do you retrieve set of records from database server. {Set max records = 100 & use paging where pager page no or records = 10 & after displaying 100 records again connect to database retrieve next 100 }
what is the difference between primary key and unique key? : Sql dba
What are nested triggers ?
6 Answers Amazon, Appeal Soft, IBM, Infosys, TCS,
what is an execution plan? When would you use it? How would you view the execution plan? : Sql dba
What is the command used to fetch the first 5 characters of a string?
Where is all the data on the internet stored?
Which command is used to call a stored procedure?
Is postgresql a server?
i have a word ***********hello********world******. I require a o/p **********hello world**********, Need to delete the middle stars.
how to get the third quarter of employee details from emp?
What is write ahead logging in sql server?
Can we update views in sql?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)