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

Teradata Vantage™ - NewSQL Engineの分析関数

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
プログラミング リファレンス
featnum
B035-1206-162K-JPN

入力

入力テーブルは、LAG式とLEAD式の例2による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;

nPath範囲一致例5の出力

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