N
N
novoreg492020-09-25 11:21:54
MySQL
novoreg49, 2020-09-25 11:21:54

How to add a new column to the SELECT value output?

It is necessary to check the correct spelling of "zhi" and "shi". To do this, you need to display all the words where there are "zhi" and "shi" with or without an error. And sign if there is an error. For example, the conclusion:
hedgehogs - right
mice - wrong
reeds - right

Declare @str nvarchar(MAX)

Set @str = 'На поле рос кряжистый дуб. Сапожник работал шылом. Расскажы это правило. Мышы, ежики, ужи, лыжы, лужи, камыши.'

SELECT value FROM STRING_SPLIT(@str, ' ') WHERE value LIKE '%жи%' or value LIKE '%ши%'
SELECT value FROM STRING_SPLIT(@str, ' ') WHERE value LIKE '%жы%' or value LIKE '%шы%'


I managed to implement the output of two selects with correct and incorrect spelling. How to add captions/second column to these words? And how can all this be done in one select?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
ThunderCat, 2020-09-25
@novoreg49

join, group buy and concat()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question