16.10 - Range-Matching Examples - 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

Whenever a user visits the home page and then visits checkout pages and buys increasingly expensive products, the nPath query returns the first purchase and the most expensive purchase.

nPath Example Input Table: aggregate_clicks
userid sessionid productname pagetype clicktime referrer productprice
1039 1 sneakers home 2009-07-29

20:17:59

Nike 100
1039 2 books home 2009-04-21

13:17:59

BarnesNoble 300
1039 3 television home 2009-05-23

13:17:59

Bestbuy 500
1039 4 envelopes home 2009-07-16

11:17:59

Staples 10
1039 4 envelopes home1 2009-07-16

11:18:16

Staples 10
1039 4 envelopes page1 2009-07-16

11:18:18

Staples 10
1039 5 bookcases home 2009-08-19

22:17:59

Ikea 150
1039 5 bookcases home1 2009-08-19

22:18:02

Ikea 150
1039 5 bookcases page1 2009-08-19

22:18:05

Ikea 150
1039 5 bookcases page2 2009-08-22

04:20:05

Ikea 150
1039 5 bookcases checkout 2009-08-24

14:30:05

Ikea 150
1039 5 bookcases page2 2009-08-27

23:03:05

Ikea 150
1040 1 tables home 2009-07-29

20:17:59

Ikea 250
1040 2 Appliance home 2009-04-21

13:17:59

GE 1500
1040 3 laptops home 2009-05-23

13:17:59

Dell 800
1040 4 chairs home 2009-07-16

11:17:59

Staples 400
1040 4 chairs home1 2009-07-16

11:18:16

Staples 400
1040 4 chairs page1 2009-07-16

11:18:18

Staples 400
1040 5 cellphones home 2009-08-19

22:17:59

Samsung 600
1040 5 cellphones home1 2009-08-19

22:18:02

Samsung 600
1040 5 cellphones page1 2009-08-19

22:18:05

Samsung 600
1040 5 cellphones page2 2009-08-22

04:20:05

Samsung 600
1040 5 cellphones checkout 2009-08-24

14:30:05

Samsung 600
1040 5 cellphones page2 2009-08-27

23:03:05

Samsung 600
... ... ... ... ... ... ...