User Tools

Site Tools


Sidebar

HPL/SQL is included to Apache Hive since version 2.0

select-into

This is an old revision of the document!


SELECT INTO Statement

SELECT INTO statement allows you to assign values to variables using a SQL SELECT query.

Example:

DECLARE cnt INT = 0;
SELECT COUNT(*) INTO cnt FROM users;
PRINT 'Users: ' || cnt; 

Compatibility: Oracle, IBM DB2, Teradata, PostgreSQL, MySQL and Netezza.

Version: HPL/SQL 0.01

See also: