I am using Sql Server 2014
I have two tables, and each has two columns. One has names and addresses(table name is dbo.tgt_address), another has common street abbreviations and a corresponding abbreviation I want to change the original abbreviation to (table name is dbo.street_abreviations).
I need a query to change the text in the Address column of the tgt_address table, where the text contains a text from the Street_abbreviation table's commonly_used column, to what the text in Abbreviation.
Output:
I understand that this could work for individual rows:
select replace(Address,'123 State St Chester PA 25374', '123 State ST Chester PA 25374')
but as there are many more records in the table that what I am reporting here, how can I create a faster process? would I need to incorporate substring() and a subselect in some way? I've tried to find documentation on this but failed so I hope someone can provide some direction to at least get me started, thank you!