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, 2022 in Database by Kithuzzz
• 38,000 points
3,036 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, 2022 in Database by Kithuzzz
• 38,000 points
710 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, 2022 in Database by Kithuzzz
• 38,000 points
756 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,750 points
29,598 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,250 points
1,612 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,370 points
1,826 views
+2 votes
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
1,531 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,300 points
1,043 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
983 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, 2022 in Database by Neha
• 9,020 points
1,434 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, 2022 in Database by Neha
• 9,020 points
8,170 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP