How to extract a digit from number in oracle?

Member

by shyann , in category: MySQL , 6 months ago

How to extract a digit from number in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

by giovanny.lueilwitz , 6 months ago

@shyann 

You can extract a digit from a number in Oracle using the following SQL query:

1
2
SELECT SUBSTR('12345', 3, 1) AS extracted_digit
FROM DUAL;


In this query, '12345' is the number from which you want to extract the digit, 3 is the starting position of the digit you want to extract, and 1 is the number of characters to extract.


This query will extract the digit '3' from the number '12345' and return it as the result.

Related Threads:

How to extract specific digit from pandas column using regex?
How to extract the year from a date in oracle?
How to extract a substring from column in oracle?
How to extract text between two words in oracle?
How to extract no. of days between 2 dates in oracle sql?
How to convert time interval in oracle to number of days in oracle?