Answer the question
In order to leave comments, you need to log in
How to write a replace function instead of a set of replaces in sql?
select
replace(replace(replace(replace(replace(name
,'олег','О')
,'Олег','О')
,'виктор','В')
,'саша','С')
,'лена','Л')
from
table1
Answer the question
In order to leave comments, you need to log in
What is the task? judging by the request code, you are trying to replace the name with an initial ... if so, then probably like this:
Select
case when <условие при котором надо брать 2 символа> then
UPPER(Left(name, 2))
else
UPPER(Left(name, 1))
end
from
table1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question