I'm trying to handle variations on the suffix Esq. in my database--Esq, Esq., ESQ, ESQ., Esquire. Are nested replaces the way to go or is there another function that deals with multiple conditions? I don't currently have any influence on getting the data cleaned up and consistent as quickly as it should be.
select replace(replace(pref_formatted_name,', ESQ',', Esquire.'),', Esq.',', Esquire')
from table
select replace(replace(pref_formatted_name,', ESQ',', Esquire.'),', Esq.',', Esquire')
from table