16.20 - Example: Querying for Case-Specific Names - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Functions, Expressions, and Predicates

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

Consider the following query:

   SELECT * 
   FROM STUDENTS 
   WHERE Firstname = 'George';

The behavior of the comparison Firstname = 'George' under different case specification attributes and session modes is described in the table that follows.

IF column Firstname is … THEN …
CASESPECIFIC
  • If the session mode is ANSI, then ‘George’ is CASESPECIFIC and the match succeeds for rows with Firstname containing ‘George’.
  • If the session mode is Teradata, then “George’ is NOT CASESPECIFIC and the match succeeds for rows with Firstname containing ‘George’.

When either character sting is CASESPECIFIC, the comparison is case specific.

NOT CASESPECIFIC
  • If the session mode is ANSI, then ‘George’ is CASESPECIFIC and the match succeeds for rows with Firstname containing ‘George’. When either character string is CASESPECIFIC, the comparison is case specific.
  • If the session mode is Teradata, then ‘George’ is NOT CASESPECIFIC and the match succeeds for rows with Firstname containing any combination of cases that spell the name George, such as ‘george’ or ‘GEORGE’ or ‘George’. When both character strings are NOT CASESPECIFIC, the comparison is case blind.