Re: Row pattern recognition - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: Row pattern recognition
Date
Msg-id 20230628.211700.191321983330956034.t-ishii@sranhm.sra.co.jp
Whole thread Raw
In response to Re: Row pattern recognition  (Vik Fearing <vik@postgresfriends.org>)
Responses Re: Row pattern recognition
List pgsql-hackers
Small question.

> This query (with all the defaults made explicit):
> 
> SELECT s.company, s.tdate, s.price,
>        FIRST_VALUE(s.tdate) OVER w,
>        LAST_VALUE(s.tdate) OVER w,
>        lowest OVER w
> FROM stock AS s
> WINDOW w AS (
>   PARTITION BY s.company
>   ORDER BY s.tdate
>   ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING
>   EXCLUDE NO OTHERS
>   MEASURES
>     LAST(DOWN) AS lowest
>   AFTER MATCH SKIP PAST LAST ROW
>   INITIAL PATTERN (START DOWN+ UP+)
>   DEFINE
>     START AS TRUE,
>     UP AS price > PREV(price),
>     DOWN AS price < PREV(price)
> );

>     LAST(DOWN) AS lowest

should be "LAST(DOWN.price) AS lowest"?

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp



pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: pg_decode_message vs skip_empty_xacts and xact_wrote_changes
Next
From: Terry Brennan
Date:
Subject: Re: Request for new function in view update