Appearance
Comparison Operators
Yellowbrick supports the following comparison operators. See also SQL Conditions.
Operator | Definition |
---|---|
< | Less than |
> | Greater than |
<= | Less than or equal to |
>= | Greater than or equal to |
= | Equal to |
<> or != | Not equal to |
BETWEEN , NOT BETWEEN | Comparison with an inclusive range of values. BETWEEN SYMMETRIC is also supported. |
IS NULL , IS NOT NULL | Comparison with null values. ISNULL and NOTNULL synonyms are also supported. See also ISNULL. |
IS TRUE , IS NOT TRUE | Comparison with Boolean values |
IS FALSE , IS NOT FALSE | Comparison with Boolean values |
IS UNKNOWN , IS NOT UNKNOWN | Comparison with Boolean values (finds null values in Boolean columns) |
IS DISTINCT FROM , IS NOT DISTINCT FROM | Identical to != or = when neither of the inputs is null . These operators treat null as a normal data value, not as "unknown."IS DISTINCT FROM returns false when both inputs are null and returns true when one of the inputs is null . IS NOT DISTINCT FROM returns true when both inputs are null and returns false when one of the inputs is null . |
Examples
premdb=# select * from season where winners is null;
seasonid | season_name | numteams | winners
----------+-------------+----------+---------
25 | 2016-2017 | 20 |
(1 row)
premdb=# select * from team where avg_att >=50;
teamid | htid | atid | name | nickname | city | stadium | capacity | avg_att
--------+------+------+-------------------+------------+------------+------------------+----------+---------
1 | 2 | 51 | Arsenal | Gunners | London | Emirates Stadium | 60260 | 59.944
24 | 25 | 74 | Manchester City | Citizens | Manchester | Etihad Stadium | 55097 | 54.041
25 | 26 | 75 | Manchester United | Red Devils | Manchester | Old Trafford | 75635 | 75.286
(3 rows)
premdb=# select * from season where seasonid is not distinct from 1;
seasonid | season_name | numteams | winners
----------+-------------+----------+-------------------
1 | 1992-1993 | 22 | Manchester United
(1 row)