|
In SQL it is possible to have multiple conditions and combine them with boolean operators (AND, OR). For negating a condition the NOT operator is used. The data is selected if the whole condition returns as TRUE.
Other examples of multiple conditions:
PLZ = 8000 AND NOT Last name = 'Schmidt'
PLZ = 8000 OR PLZ = 8006
(Last Name = 'Müller' OR Last name = 'Meier') AND Place = 'Zürich'
Instead of a long chaining with AND there is also the possibility to compare several attributes simultaneously with each
other:
First name = 'Ursula' AND Last name = 'Müller'
newLine space="long"/>
can be written as:
(First name, Last name) = ('Ursula', 'Müller')