Your where clause will return all rows where tester does not match username AND where tester is not null.

If you want to include NULLs, try:

where tester <> 'username' or tester is null

If you are looking for strings that do not contain the word "username" as a substring, then like can be used:

where tester not like '%username%'
Answer from Gordon Linoff on Stack Overflow
๐ŸŒ
W3schools
w3schools.tech โ€บ tutorial โ€บ sql โ€บ sql-not-equal
SQL - NOT EQUAL: A Comprehensive Guide for Beginners - SQL Operators and Clauses - W3schools
Think of the NOT EQUAL operator as a bouncer at a club. You're telling it, "Don't let any dogs in!" The bouncer (NOT EQUAL) stands at the door, checking each 'animal_type', and only letting in the non-dogs. And there you have it, folks! You've just learned the ins and outs of the SQL NOT EQUAL operator.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ sql โ€บ sql-not-equal-operator
SQL NOT EQUAL Operator - GeeksforGeeks
December 29, 2023 - First, we will create a demo SQL database and table on which we will use the NOT EQUAL operator. In this example, we display all those rows which do not have a name equal to 'Harsh'. We will use NOT EQUAL with WHERE clause in this case. ... Note: The NOT EQUAL comparison is case-sensitive for strings.
๐ŸŒ
Tutorialspoint
tutorialspoint.com โ€บ sql โ€บ sql-not-equal.htm
SQL - NOT EQUAL Operator
We can use "<>" or "!=" in the WHERE clause of a SQL statement and exclude rows that match a specific text value. In the following query, we are retrieving all the records from the CUSTOMERS table whose NAME is not 'Ramesh': ... We can use the NOT EQUAL operator with the GROUP BY clause to ...
๐ŸŒ
AlmaBetter
almabetter.com โ€บ bytes โ€บ tutorials โ€บ sql โ€บ equal-and-not-equal-to-in-sql
Equal and Not Equal to in SQL
The Not Equal ( != or <>) and Equal ( = ) operators are utilized in SQL to compare two expressions and decide whether they are equal or not. Not Equal in SQL will return true when two expressions are not equal and false when they are equal.
๐ŸŒ
W3Schools
w3schools.com โ€บ postgresql โ€บ postgresql_operators.php
PostgreSQL - Operators
Return all records where the year is greater than or equal 1975: SELECT * FROM cars WHERE year >= 1975; Run Example ยป ยท The <> operator is used when you want to return all records where a column is NOT equal to a specified value:
๐ŸŒ
SQL Shack
sqlshack.com โ€บ sql-not-equal-operator
SQL Not Equal Operator introduction and examples
May 21, 2021 - We can use both SQL Not Equal operators <> and != to do inequality test between two expressions. Both operators give the same output. The only difference is that โ€˜<>โ€™ is in line with the ISO standard while โ€˜!=โ€™ does not follow ISO standard.
๐ŸŒ
w3resource
w3resource.com โ€บ mysql โ€บ comparision-functions-and-operators โ€บ not-equal-operator.php
MySQL not equal to operator - w3resource
-- This SQL query selects specific columns from two tables (tableA and tableB) SELECT a.column1, b.column2 FROM tableA a -- Specifies tableA as 'a' for reference JOIN tableB b -- Joins tableB as 'b' for reference ON a.id <> b.id; -- Condition for joining: selects rows where 'id' in tableA is not equal to 'id' in tableB
Find elsewhere
๐ŸŒ
Hightouch
hightouch.com โ€บ sql-dictionary โ€บ sql-not-equal-to
SQL Not Equal To - Syntax, Use Cases, and Examples | Hightouch
January 3, 2024 - The SQL "Not Equals To" operator, denoted as "<>", "!=", or "NOT =", is used to compare values in a database table and retrieve rows where a specific column's value does not match a given criteria.
๐ŸŒ
Codecademy
codecademy.com โ€บ docs โ€บ sql โ€บ operators โ€บ not equal to
SQL | Operators | NOT EQUAL TO | Codecademy
April 24, 2025 - In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language. ... The column_name represents the column being evaluated, and value is the specific criterion being compared. Note: Although both <> and != symbols can be used for the NOT EQUAL TO operator, <> follows the ISO standard while != does not.
๐ŸŒ
Mimo
mimo.org โ€บ glossary โ€บ sql โ€บ not-equal
SQL Not Equal: Syntax, Usage, and Examples
Use indexes wisely. Not equal conditions often cause full table scans. Be explicit in your logic. Donโ€™t assume that <> 'admin' means non-users. It means everything except 'admin'. The SQL not equal operator gives you direct control over what to leave out in your result sets.
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ sql โ€บ t-sql โ€บ language-elements โ€บ not-equal-to-transact-sql-exclamation
!= (Not Equal To) (Transact-SQL) - SQL Server | Microsoft Learn
Applies to: SQL Server Azure SQL ... in Microsoft Fabric SQL database in Microsoft Fabric ยท Tests whether one expression is not equal to another expression (a comparison operator)....
๐ŸŒ
DataCamp
datacamp.com โ€บ tutorial โ€บ sql-not-equal
SQL NOT EQUAL Operator: A Beginner's Guide | DataCamp
December 10, 2024 - Notably, SQL provides two symbols for denoting inequality: <> and !=, both serving the same purpose but with <> being the preferred choice for adhering to ISO standards. The NOT EQUAL operator (<> or !=) is used for querying data from a table that does not meet a certain condition.
๐ŸŒ
W3Schools
w3schools.com โ€บ sql โ€บ sql_null_values.asp
SQL NULL Values - IS NULL and IS NOT NULL
A field with a NULL value is a field with no value. If a field in a table is optional, it is possible to insert a new record or update a record without adding a value to this field.
๐ŸŒ
MSSQLTips
mssqltips.com โ€บ home โ€บ sql not equal examples
SQL NOT EQUAL Examples
December 31, 2024 - The following example shows an IF that compares a string data type variable to a hard coded string value. --Ignore test user IF @UserLogin <> 'TestUser' BEGIN END ยท The not equal operators can be used with a numeric data type including int, bigint, smallint, tinyint, numeric, decimal, float, real, and money).
๐ŸŒ
Enterprise DNA
blog.enterprisedna.co โ€บ sql-not-equal-operator
SQL Not Equal Operator: A Detailed Guide for Beginners โ€“ Master Data Skills + AI
Hereโ€™s an example using the LIKE operator to select all tracks with names starting with the word โ€œLetโ€: ... In SQL, null values act as placeholders for the absence of a value in a field. Using the Not Equal operator (<> or !=) with null values will not evaluate to true or false.
๐ŸŒ
Database Guide
database.guide โ€บ sql-not-equal-to-operator-for-beginners-exclamation-equals-sign
SQL Not Equal To (!=) Operator for Beginners
Our query uses the not equal to operator (!=) to test whether the OwnerId column is not equal to 3. The query returns all owners except owner number 3. When comparing with a string value, use quotes around the string.
๐ŸŒ
W3Schools
w3schools.com โ€บ sql โ€บ sql_not.asp
SQL NOT Operator
SQL Examples SQL Editor SQL Quiz ... SQL Certificate SQL Training ... The NOT operator is used in combination with other operators to give the opposite result, also called the negative result....
๐ŸŒ
Microsoft Learn
learn.microsoft.com โ€บ en-us โ€บ sql โ€บ t-sql โ€บ language-elements โ€บ not-equal-to-transact-sql-traditional
<> (Not Equal To) (Transact-SQL) - SQL Server | Microsoft Learn
If either or both operands are NULL, see the topic SET ANSI_NULLS (Transact-SQL). ... expression Is any valid expression. Both expressions must have implicitly convertible data types. The conversion depends on the rules of data type precedence. ... The following example returns all rows in the Production.ProductCategory table that do not have value in ProductCategoryID that is equal to the value 3 or the value 2.