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
🌐
GeeksforGeeks
geeksforgeeks.org › sql › sql-not-equal-operator
SQL NOT EQUAL Operator - GeeksforGeeks
3 weeks ago - The SQL NOT EQUAL operator compares two values and returns true if they are not equal. It’s used to filter out matching records in queries. If the values are equal, it returns false; if either value is NULL, it returns NULL.
🌐
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.
🌐
CommandPrompt Inc.
commandprompt.com › education › postgresql-not-equal-to-operator
PostgreSQL Not equal to (!=) Operator — CommandPrompt Inc.
March 2, 2023 - For instance, in the below snippet, we utilize the “!=” operator to compare a “lowercase” string with “uppercase”: ... The output signifies that the “!=” operator performs a case-sensitive comparison. Example 4: Using Not Equal Operator “!=” on Postgres Table’s Data
🌐
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).
🌐
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
Applies to: SQL Server Azure SQL ... When you compare nonnull expressions, the result is TRUE if the left operand is not equal to the right operand; otherwise, the result is FALSE....
🌐
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....
Find elsewhere
🌐
JanbaskTraining
janbasktraining.com › home › a complete overview of sql not equal operator with examples
A Complete Overview Of SQL Not Equal Operator with Examples| JanBask Training
October 19, 2024 - The query SQL Not Equal Operator (<>) shows the comparison of gender column value with string value ‘Female’ to retrieve male patient data
🌐
W3Schools
w3schools.com › sql › sql_where.asp
SQL WHERE Clause
SQL Examples SQL Editor SQL Quiz SQL Exercises SQL Server SQL Syllabus SQL Study Plan SQL Bootcamp SQL Certificate SQL Training ... The WHERE clause is used to filter records. It is used to extract only those records that fulfill a specified condition. ... SELECT column1, column2, ... FROM table_name WHERE condition; Note: The WHERE clause is not only used in SELECT statements, it is also used in UPDATE, DELETE, etc.!
🌐
Snowflake Documentation
docs.snowflake.com › en › sql-reference › operators-comparison
Comparison operators | Snowflake Documentation
Comparison operators are used to test the equality of two input expressions. They are typically used in the WHERE clause of a query · a is not equal to b
🌐
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
August 10, 2023 - 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.
🌐
Scaler
scaler.com › topics › sql › not-equal-in-sql
Not Equal in SQL - Scaler Topics
May 18, 2022 - The part of SQL query which contains the not equal operator is shown below, ... The expression1 and expression2 could be any number, text, constant value, or column value accessed through the select statement. The default strings comparison in SQL is case insensitive which means the statement 'ABC' <> 'abc' will evaluate to false.
🌐
Mimo
mimo.org › glossary › sql › not-equal
SQL Not Equal: Syntax, Usage, and Examples
The not equal operator isn’t just for comparing a column to a fixed value. You can use it between two columns as well: ... This query returns orders where the billing and shipping addresses are different. Use SQL not equal with AND, OR, or IN for more complex filters:
🌐
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
3 weeks ago - 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)....
🌐
W3Schools
w3schools.com › sql › sql_operators.asp
SQL Operators
String Functions: ASCII CHAR_LENGTH CHARACTER_LENGTH CONCAT CONCAT_WS FIELD FIND_IN_SET FORMAT INSERT INSTR LCASE LEFT LENGTH LOCATE LOWER LPAD LTRIM MID POSITION REPEAT REPLACE REVERSE RIGHT RPAD RTRIM SPACE STRCMP SUBSTR SUBSTRING SUBSTRING_INDEX TRIM UCASE UPPER Numeric Functions: ABS ACOS ASIN ATAN ATAN2 AVG CEIL CEILING COS COT COUNT DEGREES DIV EXP FLOOR GREATEST LEAST LN LOG LOG10 LOG2 MAX MIN MOD PI POW POWER RADIANS RAND ROUND SIGN SIN SQRT SUM TAN TRUNCATE Date Functions: ADDDATE ADDTIME CURDATE CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP CURTIME DATE DATEDIFF DATE_ADD DATE_FORMAT DA
🌐
GeeksforGeeks
geeksforgeeks.org › pl/sql › pl-sql-not-equal-operator
PL/SQL NOT EQUAL Operator - GeeksforGeeks
July 23, 2025 - The NOT EQUAL operator in PL/SQL is represented by != or <>. It is used to check if two expressions or values are not equal to each other.
🌐
Quora
quora.com › How-do-you-write-not-equal-to-in-an-SQL-query
How to write “not equal to” in an SQL query - Quora
Answer (1 of 6): You use not equal to” to specify a condition ot two values not being queal to each other in the set of values that are the base of your selection. It is not very clear - though - what is the purpose of this question: do you want to know for what purpose you use the “not ...