SELECT a, b, c
FROM my_table
WHERE a<>b AND a<>c AND b<>c
Access query to retrieve all three fields not equal
-
30-06-2023 - |
Frage
I need to write a query in MS Access where all the three columns should not be equal .
For example there are three columns A B C . Each column should not be equal to each other all should have a separate value.
How can I write such a query?
Lösung
Andere Tipps
If your fields are non-nullable, all you need to check is that A != B, A != C, and B != C:
SELECT *
FROM test
WHERE A <> B AND A <> C AND B <> C
The same query would be OK if fields are nullable, but NULL
s are not considered a valid value.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow