A condition is a combination of expressions and operators that evaluate to TRUE or FALSE.
Conditions can contain comparison operators (Severity < 3), logical operators (NOT(Is_Enabled)), and list comparison operators (Severity IN ANY(0,5)).
Valid conditions are shown in the following list:
TRUE | FALSE
( condition )
NOT condition
condition AND condition
condition OR condition
expression operator expression
expression operator ANY ( expression, ... )
expression operator ALL ( expression, ... )
expression[ NOT ] IN( subquery )
expression operator ANY ( subquery )
expression [ NOT ] IN ( expression, ... )
expression [ NOT ] LIKE regexp_pattern
expression [ NOT ] LIKE ANY ( regexp_pattern, ... )
expression [ NOT ] LIKE ALL ( regexp_pattern, ... )
You can combine conditions into increasingly complex conditions.
(Severity > 4) AND (Node = 'node%')
The following example shows the use of a condition in a subquery:
select * from alerts.status where Serial in (select Serial from alerts.journal);