16.20 - Example Query - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL External Routine Programming

Product
Advanced SQL Engine
Teradata Database
Release Number
16.20
Release Date
April 2020
Content Type
Programming Reference
Publication ID
B035-1147-162K
Language
English (United States)
SELECT * FROM Sessionize (ON td2 USING TimeCol('eventinfo') timeout(30))
AS J1;

CREATE SET TABLE UT1.td2 ,NO FALLBACK ,
     NO BEFORE JOURNAL,
     NO AFTER JOURNAL,
     CHECKSUM = DEFAULT,
     DEFAULT MERGEBLOCKRATIO
     (
     guid INTEGER,
     payload VARCHAR(2048) CHARACTER SET LATIN NOT CASESPECIFIC,
     eventinfo TIMESTAMP(6))
;

SELECT guid, sessionid FROM Sessionize (ON td2 USING 
TimeCol('eventinfo') timeout(30)) AS J1;

*** Query completed. 5 rows found.

       GUID    SessionID
-----------  -----------
         33            1
         33            2
         33            2
         33            2
         33            3

SELECT * FROM td2;

*** Query completed. 5 rows found.

       guid  payload                         eventinfo
-----------  ------------------------------  ---------
         33  http://dougfy.wikidot.com/debu  2013-06-09 20:21:44.000000
         33  http://dougfy.wikidot.com/debu  2013-06-10 19:08:55.000000
         33  http://dougfy.wikidot.com/debu  2013-06-10 19:09:01.000000
         33  http://dougfy.wikidot.com/debu  2013-06-10 19:09:04.000000
         33  http://dougfy.wikidot.com/debu  2013-06-10 19:09:41.000000