Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Stripping the streetname from the number 1

Status
Not open for further replies.

Zargo

Programmer
Mar 21, 2005
109
Hi,

I hope this will be the last quesion for today. I have a table with streetnames and housenumbers. I want to update this column with only the streetname and put the housenumber in another column. The table which i have is look like:

TableA
street | supplement
My street 123 |
StreetABC 56 |


After the update the table needs to look like:

TableA
street | supplement
My street | 123
StreetABC | 56

Thanks for the last time...

 

Try this, but be aware if there is an 'apartment number' next to the street number (vg 'The Streetx 123 apt 45'), it will not work:
Code:
Select
       substr(street,1,instr(street,' ',-1)) as street
     , substr(street,instr(street,' ',-1)+1) as suplement
  From TableA;
[3eyes]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top