nPath範囲一致例: いずれかのセッションに複数のリファラーを含む最初の製品の検索 - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - Advanced SQL Engine分析関数

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
2020年6月
Language
日本語
Last Update
2021-03-30
dita:mapPath
ja-JP/mld1565890109978.ditamap
dita:ditavalPath
ja-JP/mld1565890109978.ditaval
dita:id
B035-1206
Product Category
Software
Teradata Vantage

入力

入力テーブルは、LAG式とLEAD式の例: 入力問合わせの別名なしによるaggregate_clicksです。

SQL-MapReduce呼び出し

SELECT * FROM nPath (
  ON aggregate_clicks PARTITION BY sessionid ORDER BY clicktime
  USING
  Mode (NONOVERLAPPING)
  Pattern ('REFERRER{2,}')
  Symbols (referrer IS NOT NULL AS REFERRER)
  Result (
    FIRST (sessionid OF REFERRER) AS sessionid,
    FIRST (productname OF REFERRER) AS product
  )
) AS dt ORDER BY dt.sessionid;

出力

sessionid product
1 envelopes
2 tables
3 bookcases
4 tables
5 Appliances