L
L
lilikon2018-08-14 23:25:34
SQL
lilikon, 2018-08-14 23:25:34

How to check if a piece of text is in a table?

Good day!
I have a problem, I need to check if there is a part of the text in the table from the mssql database.
There is a table:
Id Data
1 0x010010000101110
2 0x011010010100110
etc.
There is also a part of the query: 1110
it is necessary to check through IF whether this part of the text is in the date
(at the beginning of the query, I only select a certain string, for example, the one where id=1 and all its variables are described, that is, you do not need to do a SELECT)
Can you tell me how to do it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
H
hokudjolsbsy, 2018-08-15
@lilikon

through if, in the sense through the sql if statement?
can't use like or regexp operators?
like, in sql if it works like this:
Can you explain this part more precisely? Does it confuse you that SELECT is written first?

C
coderisimo, 2018-08-15
@coderisimo

SELECT IF("PIVO" LIKE "%VO%" , "YES", "NO");

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question