troubleshooting Question

Address column split and case when statements

Avatar of Basssque
Basssque asked on
Oracle DatabaseSQL
10 Comments1 Solution67 ViewsLast Modified:
I'm currently using the following statement to split address columns
SUBSTR(STREET, 1, INSTR(STREET, ' ')-1) AS HouseNumber,
SUBSTR(STREET, INSTR(STREET, ' ')+1) AS Street,

In this case, 50 Main St is split into two columns
50, Main St

Is it possible to add a third column to split letters out from the house number?
In this case 50D Main St is out put like 50,D,Main St AND 50 Main St would be output like 50,,Main St

I also need to strip leading spaces from the Street after the split or replace instances of more than one space with a single space prior to the split

Last, if I have an House_Number values of
100
200
50
How can I sort them in order so 50 comes before 100 opposed to after 200?

Thanks!!!
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros