Skip to content

select into

Tako Lee edited this page May 27, 2017 · 30 revisions

select into, can be used to select record into table(maybe temporary table) or variable.

  • select into table Greenplum
    PostgreSQL

    SQL Server/Sybase/ODBC: Temporary tables come in different flavours including, amongst others, local temporary tables (starting with #), global temporary tables (starting with ##), persistent temporary tables (prefixed by TempDB..), and table variables.(starting with (@)

  • select into variable|variable list|record name

    DB2: SELECT INTCOL1 INTO MYINTARRAY1[INTCOL2+MYINTVAR+1] FROM T1
    Informix
    MySQL: SELECT id, data INTO @x, @y FROM test.t1 LIMIT 1;
    Oracle
    Teradata: select * into [:]host_variable_name

Clone this wiki locally