2
I have a field EUW010598260, and needed you to stay EUW1598260
I need to remove a specific field
SQL:
SELECT 'EUW' + substring(campo,patindex('%[^EUW0 ]%',campo + ' ')
,len(campo)) AS campo1
,campo2
FROM [tabela]
WHERE campo3 = 'cp'
AND campo LIKE '%EUW0%'
if the EUW0 prefix is always at the beginning of the Voce string you can use the SUBSTR.
– Euler01
what complicates is EUW010 has to stay EUW1. If it’s EUW012 it would be EUW12, right? The question is unclear. You need to explain what the pattern of this string is.
– Daniel Omine