A condition is a combination of expressions and operators that return TRUE, FALSE or NULL.The following syntax shows the conditions that can be used to return a TRUE, FALSE,or NULL condition.
filter: column| literal| function [=|!=|<>|<|<=|>=|>] column| literal| function | select_statement column| function [NOT] IN (select_statement | literal, literal,...) column| function [NOT] BETWEEN (select_statement | literal, literal,...) column| function IS [NOT] NULL string_column|string_function [NOT] LIKE pattern EXISTS (select_statement) NOT (filter) (filter|function) [AND|OR] (filter|function)
Note: A ‘literal’ may be a constant (e.g. 3) or an expression that evaluates to a constant [e.g. 100 - (27 * 3)]. For date columns, you may use the SQL ‘interval’ syntax to perform date arithmetic, as long as all the components of the expression are constants (e.g. ‘1998-12-01’ - interval ‘1’ year)
ColumnStore, unlike the MyISAM engine, is case sensitive for string comparisons used in filters. For the most accurate results, and to avoid confusing results, make sure string filter constants are no longer than the column width itself.
Pattern matching as described with the LIKE condition allows you to use “_” to match any single character and “%” to match an arbitrary number of characters (including zero characters). To test for literal instances of a wildcard character, (“%” or “_”),precede it by the “\” character.
OR Processing has the following restrictions:
SELECT count(*) from lineitem WHERE l_partkey < 100 OR l_linestatus =‘F‘;
SELECT count(*) FROM orders, lineitem WHERE (lineitem.l_orderkey < 100 OR lineitem.l_linenumber > 10) AND lineitem.l_orderkey =orders.o_orderkey;
The following syntax show the conditions you can use when executing a condition against two columns. Note that the columns must be from the same table.
col_name_1 [=|!=|<>|<|<=|>=|>] col_name_2
The following syntax show the conditions you can use when executing a join on two tables.
join_condition [AND join_condition] join_condition: [col_name_1|function_name_1] = [col_name_2|function_name_2]
Notes:
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/columnstore-conditions/