Hi @Ivann38 ,
Welcome to the microsoft tsql Q&A forum!
Sorry, your description is not clear enough for me.For this type of problem we recommend that you post CREATE TABLE statements for your tables together with INSERT statements with sample data,We also need to see the expected result of the sample.
If you want to find multiple fields at the same time, please refer to:
select reason,reason1
from company
where SUBSTRING(reason,3,50) like '1%'
or SUBSTRING(reason,3,50) like '2%'
or SUBSTRING(reason,3,50) like '3%'
or SUBSTRING(reason1,3,50) like '1%'
or SUBSTRING(reason1,3,50) like '1%'
or SUBSTRING(reason1,3,50) like '1%'
If you want to combine the conditions behind where, please refer to:
select reason
from company
where SUBSTRING(reason,3,50) like '[1-3]%'
You can replace [1-3] in the above statement with the range you want.
If you have any question, please feel free to let me know.
Regards
Echo
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.