In SQL Server. if you wanted addresses that contained characters other than alphanumerics and spaces:

address LIKE '%[^0-9a-zA-Z ]%';

noting the ^ character means "any single character not within the specified range". Not sure if something very similar is possible in DB2.

Answer from onedaywhen on Stack Overflow
🌐
Stack Overflow
stackoverflow.com › questions › 74655357 › what-is-the-opposite-of-like-in-sql
search - What is the "opposite" of LIKE in sql? - Stack Overflow
... Please rephrase your question by showing clear sample input table and the expected output. ... your title and question are two different things. The opposite of LIKE is NOT LIKE but that seems unrelated to your actual question.
🌐
LearnSQL.com
learnsql.com › blog › like-sql-not-like
What Do the Operators LIKE and NOT LIKE Do? | LearnSQL.com
SQL NOT LIKE operator behaves as you might expect, essentially returning the opposite of what the LIKE operator would.
🌐
W3Schools
w3schools.com › sql › sql_like.asp
SQL LIKE Operator
SELECT * FROM Customers WHERE CustomerName LIKE '_r%'; Try it Yourself » · If no wildcard is specified, the phrase has to have an exact match to return a result. ... If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected] · If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected] · HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial
🌐
ObjectRocket
kb.objectrocket.com › postgresql › sql-not-like-with-postgresql-631
SQL NOT LIKE with PostgreSQL | ObjectRocket
Now that you understand the LIKE operator let’s look at NOT LIKE. NOT LIKE is the exact opposite of the LIKE OPERATOR. It will return true for any string that doesn’t match the pattern.
🌐
Programiz
programiz.com › sql › like-operator
SQL LIKE and NOT LIKE Operators (With Examples)
SELECT column1, column2, ... FROM table_name WHERE column NOT LIKE value; ... Here, the SQL command selects all customers except those whose country is USA.
🌐
W3Schools
w3schools.com › sql › sql_not.asp
SQL NOT Operator
SQL Examples SQL Editor SQL Quiz SQL Exercises SQL Server SQL Syllabus SQL Study Plan SQL Bootcamp SQL Certificate SQL Training ... The NOT operator is used in combination with other operators to give the opposite result, also called the negative ...
🌐
Educative
educative.io › answers › what-is-not-like-operator-in-sql
What is NOT LIKE operator in SQL?
The NOT LIKE operator is a negation of the LIKE operator. The following is the basic syntax for using SQL’s NOT LIKE operator.
🌐
Tutorial Gateway
tutorialgateway.org › home › mysql › mysql not like operator
MySQL NOT LIKE Operator
March 25, 2025 - The MySQL NOT LIKE Operator is exactly opposite to Like Operator. MySQL Not Like return rows whose values are not matching with given pattern
Find elsewhere
🌐
w3resource
w3resource.com › mysql › comparision-functions-and-operators › not-like.php
MySQL not like operator - w3resource
-- This SQL query selects the name and country of authors -- Explanation: The query retrieves information from the 'author' table, filtering out authors whose names start with the letter 'W'. SELECT aut_name, country -- Selecting specific columns aut_name and country from the 'author' table FROM author -- Specifying the table 'author' from which to retrieve the data WHERE aut_name NOT LIKE 'W%'; -- Filtering the rows based on the author's name, selecting rows where the author's name does not start with 'W'
🌐
DigitalOcean
digitalocean.com › community › tutorials › sql-like-sql-not-like
SQL Like - SQL Not Like | DigitalOcean
August 4, 2022 - SELECT CustomerName FROM Customer WHERE CustomerName LIKE 'Am%' OR CustomerName LIKE 'Jo%'; That’s all for SQL like operator and SQL not like operator examples.
🌐
Data.world
docs.data.world › documentation › sql › concepts › basic › LIKE_and_NOT_LIKE.html
LIKE and NOT LIKE | SQL Tutorial Documentation on data.world
September 30, 2025 - Data is often messy and inconsistent, and yet you’d like to be able to find and use it even if values that mean the same thing are written slightly differently and so don’t match exactly from row to row in a table. Similarly there are often times you’d like to exclude data from a query but you want to exclude several different ways it could have been written in the original table.
🌐
DB Vis
dbvis.com › thetable › a-complete-guide-to-the-sql-like-operator
A Complete Guide to the SQL LIKE Operator
June 17, 2024 - Still, it does not support regular regex. The opposite of the LIKE operator is the NOT LIKE SQL operator. While LIKE is used to match patterns, NOT LIKE is used to exclude rows that match the specified pattern.
🌐
IBM
ibm.com › docs › en › qmf › 13.1.0
Selecting rows using opposite conditions
You specify the opposite of any condition by typing NOT before the entire condition.
🌐
GeeksforGeeks
geeksforgeeks.org › sql server › sql-server-like-operator
SQL Server LIKE Operator - GeeksforGeeks
December 1, 2023 - NOT LIKE Operator is working opposite as LIKE Operator do. The NOT LIKE Operator to find information that does not match any condition.
🌐
MSSQLTips
mssqltips.com › home › sql like statement for string pattern matching
SQL LIKE Statement for String Pattern Matching
February 23, 2022 - SELECT * FROM Person.EmailAddress WHERE EmailAddress NOT LIKE '%[0-9]@%.com' AND EmailAddress NOT LIKE '%[0-9]@%.ca'; The final wildcard that can be used allows us to ensure that a character in a certain place in the string does not match a specific character. Going back to the earlier example where we were searching for email addresses with only ‘ken[0-9]’, what if in a different scenario we were looking for the opposite and wanted to exclude these but include all other email address that start with ‘ken’?
🌐
SQL Team
sqlteam.com › forums › topic.asp
SQL Like statment (reverse) - SQL Server Forums
Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
🌐
Reddit
reddit.com › r/sql › issue with using like %% when values are similar
r/SQL on Reddit: Issue with using LIKE %% when values are similar
March 1, 2025 -

Hello, sorry if this is a dumb question but I would love some input if anyone can help.

I have a column called ‘service type’ . The values in this column are from a pick list that could be a combination of eight different values. Some of the values might just have one, some might have four, some might have all eight. It can be any variation of combination.

I need to select only the rows that contain the value: “Sourcing/Contracting”. The problem i am having is that another one of these values include the words: “Non Hotel Sourcing/Contracting”.

So my issue is that if I write a SQL statement that says LIKE “%Sourcing/Contracting%”, then that will also pull in rows that might ONLY include the value of “Non Hotel Sourcing/Contracting”.

So, regardless of whether or not the value of ‘Non Hotel Sourcing/Contracting’ is listed, I just need to ensure that ‘Sourcing/Contracted’ is listed in the values.

I hope this makes sense and if anyone can help, you would save my day. How do I say that I need only the rows that contain a certain value when that certain value is actually a part of another value? Nothing is working. Thank you in advance.

SOLVED! I’m sure many of these suggestions work but u/BrainNSFW give me a couple of options that I quickly was able to just tweak and they work perfectly. And just for the record I didn’t create this. I just started working at this place and just trying to get my reports to run properly. Glad to know it wasn’t just user error on my end. Thank you for being such a helpful group.🤍🤍🤍