Comparing Literals¶
The comparison of text
values is case-sensitive. That is, when
comparing literals with the operators =
, <>
, <
, >
,
<=
and >=
, in the ORDER BY
clause, when evaluating the join
conditions involving values of type text
, etc., the case of the
value is taken into account.
If the Execution Engine pushes down to a data source a condition that compares a literal, the Execution Engine
assumes that the source does case-sensitive comparisons (like the Execution Engine does). If that is not the case (for example, if the source is Microsoft SQL Server), the results may be
wrong. If you know the
source does case-insensitive comparisons, use the functions UPPER
or LOWER
in your query to compare literals.
SELECT count(*) as satisfied_customers_count
FROM customer_satisfaction_form
WHERE UPPER (satisfied) = 'Y';
The Execution Engine does not push down these functions automatically to the sources because it would significantly make all the queries to these types of sources slower.