SQLTeam.com | Weblogs | Forums

Sql query help

Hi Guys

Hope everyone is well, i have a field called NAME with some data as shown below

Name
RECA-AA-3-CCC-1
RECA-AB-31-abc-1
RECA-C-3-T

I am trying to write a select statement ( or a script) to remove the Characters 'RECA-' from the names ( shown above) so the output result should be as below

Name
AA-3-CCC-1
AB-31-abc-1
C-3-T

can anyone help me with this?

Thank you

You can use REPLACE to do that:

SELECT REPLACE(Name, 'RECA-','') AS Name

REPLACE (Transact-SQL) - SQL Server | Microsoft Docs

Does the replace , replace the data in the back end table? as i just want to pull out the name data without the 'RECA-'?

Might help you to read up what SELECT does

REPLACE will not change the data in the back end table, only an UPDATE statement can do that.