Example: Using the WHERE Clause - Analytics Database - Teradata Vantage

DATASET Data Type

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2023-10-30
dita:mapPath
bka1628112240653.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
ekk1458586304878
lifecycle
latest
Product Category
Teradata Vantageā„¢

Example: Using the WHERE Clause (AVRO)

Using the table Myavrotable09:

/*determine if any sale included a bicycle*/

SELECT 'TRUE'
FROM Myavrotable09
WHERE 'bicycle' = ANY(avroFile.."Item_Name");

Result:

> TRUE
/*determine if any sale was for more than $50*/ 

SELECT 'TRUE'
FROM Myavrotable09
WHERE 50 < ANY(avroFile.."Total_Price");

Result:

> TRUE
/*determine if ALL sales were for more than $50*/ 

SELECT 'TRUE'
FROM Myavrotable09
WHERE 50 < ALL(avroFile.."Total_Price");

Result:

> TRUE

Example: Using the WHERE Clause (CSV)

Using the table MyCSVtable09:

/*determine if any sale included a basketball*/

SELECT 'TRUE'
FROM MyCSVtable09
WHERE 'Basketball' = ANY(csvFile.."ItemName");

Result:

> TRUE
/*determine if any sale was for more than $15*/ 

SELECT 'TRUE'
FROM MyCSVtable09
WHERE 15 < ANY(csvFile.."Total_Price");

Result:

> TRUE
/*determine if ALL sales were for more than $50*/ 

SELECT 'TRUE'
FROM MyCSVtable09
WHERE 50 < ALL(csvFile.."Total_Price");

Result:

*** No rows found