SQLite: Search for unequal Value
Question by Guest | 2016-02-08 at 15:36
I would like to read out the data records from my table / database which are not containing a specific value in a specific column.
So, I need something like an unequal, unlike, distinct or disparate comparison with a defined value. In other database systems, I have used the comparison operator != for that, but that seems not to work in SQLite. However, the operators =, < and > are working, but I do not need them at this point.
How should the statement look like to make it work?
Related Topics
The Askingbox Search
Info | 0 Comments
How to Replace multiple Texts at the same Time
Tutorial | 0 Comments
SQLite: String and Column Concatenation using SQLite
Info | 0 Comments
MySQL: Combine full text search with LIKE search for words with 3 letters
Tutorial | 2 Comments
Hidden Google Easter Eggs
Info | 1 Comment
Send Form Input as an Array to PHP Script
Tip | 0 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
In SQLite, you have to use the operator <> for inequality. Here is an example for an integer and a string comparison:
Using the first statement, we get all our records where the column "weight" is not 100, the second statement returns all records, where the column "firstname" is not "Peter".
As you can see, strings have to be enclosed with apostrophes, and you do not have to care about that with numbers.
2016-02-09 at 18:17