Example: Querying for Case-Specific Names - Advanced SQL Engine - Teradata Database

SQL Functions, Expressions, and Predicates

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-30
dita:mapPath
tpt1555966086716.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1145
lifecycle
previous
Product Category
Teradata Vantage™

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.