How to test for equality or inequality in a set of columns
You can use the equal operator or the not equal operator to test whether a set of columns is equal or not equal to a set of values.
- Example
- To select the rows in which the department number is A00 and the education level is 14, you can use this query:
SELECT FIRSTNME, LASTNAME FROM EMP WHERE (DEPT, EDL) = ('A00', 14);
- Example
- To select the rows in which the department number is not A00, or the education level is not 14, you can use this query:
SELECT FIRSTNME, LASTNAME FROM EMP WHERE (DEPT, EDL) <> ('A00', 14);