Answer the question
In order to leave comments, you need to log in
How to reformat a string to SURNAME_IO?
Hello colleagues.
There was a problem.
There is a line Surname Name Patronymic how to translate to the form SURNAME_IO using sql?
SELECT REPLACE(UPPER(usersid), ' ', '_') as m FROM applications
Answer the question
In order to leave comments, you need to log in
concat_ws(
"_",
last_name,
concat_ws(
"",
(select LEFT(firstname, 1) from applications),
(select LEFT(middlename, 1) from applications)
)
)
SELECT [ROW_ID]
,[ФИО]
,upper(SUBSTRING (([ФИО]),1,CHARINDEX(' ',[ФИО])-1)+'_'+SUBSTRING (([ФИО]),CHARINDEX(' ',[ФИО])+1,1) +''+
SUBSTRING (([ФИО]),(CHARINDEX(' ',[ФИО])+CHARINDEX(' ',SUBSTRING (([ФИО]),CHARINDEX(' ',[ФИО])+1,100)))+1,1))
FROM [Карточки регистрации] k
where k.[ROW_ID] in (908,247,809)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question