Skip to content Skip to sidebar Skip to footer

How Can I Use Substring And Replace In One Sql-statement?

SELECT TOP 1 REPLACE(name, '*Deleted*', '' ) FROM OBJ_R) AS lastname and SELECT SUBSTRING(NAME FROM 1 FOR POSITION(',' IN NAME)-1) FROM OBJ_R instead of Deleted Beyeler, Nicole

Solution 1:

You can nest functions:

SUBSTRING(REPLACE(name, '*Deleted*', '' ) FROM 1 FOR POSITION(',' IN REPLACE(name, '*Deleted*', '' ))-1) FROM OBJ_R

Post a Comment for "How Can I Use Substring And Replace In One Sql-statement?"