16.10 - Example 4: Use OVERLAPPING Mode - Teradata Database

Teradata Analytic Functions

prodname
Teradata Database
vrm_release
15.10
16.10
created_date
November 2017
category
Programming Reference
featnum
B035-1206-151K

SQL-MapReduce Call

SELECT * FROM NPATH (
   ON aggregate_clicks
   PARTITION BY sessionid
   ORDER BY clicktime
   USING
   MODE (overlapping)
   PATTERN ('A.A')
   SYMBOLS (TRUE AS A)
   RESULT (FIRST(sessionid OF A) AS sessionid,
   ACCUMULATE (pagetype OF A) AS path)
) as dt ORDER BY dt.sessionid;

Output

nPath Range-Matching Example 4 Output Table
sessionid path
1 [home, home]
1 [home, home]
1 [home, home]
1 [home, home]
1 [home, home]
1 [home, home]
1 [home, home]
1 [home, home]
1 [checkout, home]
1 [page1, checkout]
1 [home1, page1]
1 [home, home1]
1 [home, home]
1 [home, home]
1 [page1, home]
1 [home1, page1]
1 [home, home1]
1 [page1, home]
1 [home1, page1]
1 [home, home1]
2 [home, home]
2 [checkout, home]
2 [checkout, checkout]
... ...