Microsoft
Software
Hardware
Network
Question : PL/SQL - Remove comma from address field
I have a table with records which inclue the field, 'addr_1', in which there may be data in 'addr_1' as in these records (only field 'addr_1' is listed, but each record contains several other fields):
addr_1
238 State St
1345 Maple St, #29
2525 Elm St, SE
5543 Oak St, SE, #12A
I want to do this in the context of a SELECT query. I need to know how to get PL/SQL to first look at each field 'addr_1' in each record in the entire table and see whether field 'addr_1' it has no commas, or a comma (or more than one comma) in it the 'addr_1' field in each record in the table.
If field 'addr_1' does not have a comma in that record, then leave field 'addr_1' as it is in that record.
If field 'addr_1 does have a comma (or more than one comma)in that record, then simply delete the comma(s) in 'addr_1' for that record and leave the rest of the text in the field as it is.
For the above data, the result would look like this:
addr_1
238 State St
1345 Maple St #29
2525 Elm St SE
5543 Oak St SE #12A
Thanks!
Answer : PL/SQL - Remove comma from address field
oops... if you only want to select, then
select replace(addr_1, ',', '') as addr_1, othercol1, col2
from tbl
Random Solutions
DOS Batch Turnkey system for Win95
Ajax Maskededitextender remove mask on postback
What is the best GUI for MySQLfor Windows and why?
Word press choosing the last picture for my article
Is it possible to automatically copy data from AS/400 to Excel (or Lotus 1-2-3) without external apps?
How to redirect a subdirectory to an alternate server and retain original URL
Reverse DNS Centos 5, Bind. shared hosting
VPN Disconnects
Delete blank line from textarea
Unix Shell script or Perl script to merge two csv text files based on a common key column