I”ve got a query that looks like:
SELECT LEN(REPLACE(address, ' CA', '')) FROM Tbl
I now need to do multiple replaces on a filed before calculating it’s length.
ie, I need to do something like:
SELECT LEN(REPLACE(address, ' CA', '') AND REPLACE(address, ' CA', '')) FROM Tbl
which is obviously incorrect SQL.
Is there a way to do this?
I’m using MS-SQL 2008 if it matters.
Yep! You just have to nest them