SUBSTR and INSTR SQL Oracle

0 votes

I've begun utilising SUBSTR and INSTR in Oracle, but when I came across this, I became perplexed.

SELECT PHONE, SUBSTR(PHONE, 1, INSTR(PHONE, '-') -1)
FROM DIRECTORY;

I get that SUBSTR trims off values and INSTR identifies the location of the occurrence, but the example I provided above has me perplexed because the outcome is 362. I was 362-127-4285 when I was first valued. How does that function?

Aug 29 in Database by Kithuzzz
• 11,640 points
21 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Database

0 votes
0 answers

Creating a new database and new connection in Oracle SQL Developer

I've introduced SQL Developer to my framework. ...READ MORE

Aug 12 in Database by Kithuzzz
• 11,640 points
20 views
0 votes
0 answers

How to create a small and simple database using Oracle 11 g and SQL Developer?

How can I build a tiny, straightforward ...READ MORE

Aug 20 in Database by Kithuzzz
• 11,640 points
30 views
0 votes
1 answer

Difference between single and double quotes in SQL

Single quotes are used to indicate the ...READ MORE

answered Sep 11, 2018 in Database by CodingByHeart77
• 3,720 points
16,938 views
0 votes
1 answer

STUFF and REPLACE function in SQL

STUFF Function: This function is used to ...READ MORE

answered Sep 28, 2018 in Database by DataKing99
• 8,240 points
782 views
0 votes
1 answer

Difference between clustered and non clustered index in SQL

The differences between the clustered and non ...READ MORE

answered Sep 28, 2018 in Database by Sahiti
• 6,380 points
949 views
+1 vote
3 answers

Difference between SQL and PL/SQL

In Oracle database administration, there are two ...READ MORE

answered Sep 25, 2019 in Database by gautham
763 views
0 votes
1 answer

Automating Oracle script with nolio

Depending upon the details of your script ...READ MORE

answered Jul 17, 2018 in Other DevOps Questions by ajs3033
• 7,280 points
358 views
0 votes
1 answer

Is there any boolean type in Oracle database?

Nope. I don't think there is one But ...READ MORE

answered Oct 10, 2018 in Database by Neha
• 6,300 points
325 views
0 votes
1 answer

Please name some online websites to compile and run PL/SQL?

For executing Oracle SQL queries and PL/SQL ...READ MORE

answered Feb 11 in Database by Neha
• 8,920 points
149 views
0 votes
1 answer

ORACLE LIVE SQL IMPORT CSV DATA (live oracle sql)

Convert CSV to SQL http://www.convertcsv.com/csv-to-sql.htm This programme may be ...READ MORE

answered Feb 11 in Database by Neha
• 8,920 points
3,132 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP