17.10 - 例: WHERE句の使用 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - DATASETデータ型

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
2021年7月
Content Type
プログラミング リファレンス
Publication ID
B035-1198-171K-JPN
Language
日本語 (日本)

例: WHERE句の使用(AVRO)

テーブルMyavrotable09を使用する場合:

/*determine if any sale included a bicycle*/

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


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

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

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

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

例: WHERE句の使用(CSV)

テーブルMyCSVtable09を使用する場合:
/*determine if any sale included a basketball*/

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


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

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

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

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