M
M
Mr. Smith2020-03-07 02:15:46
SQL
Mr. Smith, 2020-03-07 02:15:46

SQL query - how to find rows that do not contain text?

Which query will display rows that do not contain certain text in a column?
For example:
- there is a table "post"
- there is a column "xfields"
- there is a phrase "boots" among a lot of other text in the xfields column It is
necessary to display all rows that do not contain the phrase boots in the xfields column.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nokimaro, 2020-03-07
@MrSS

SELECT * FROM post WHERE xfields NOT LIKE '%boots%'

Please note that LIKE %% does not use indexes and such a query will always result in a fullscan of the table.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question