Created
July 22, 2020 18:19
-
-
Save Nxtra/d4848af6170e931db70667986aa6ce29 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE PUMP "SPEED_CHANGE_PUMP" AS | |
INSERT INTO "SPEED_CHANGE_SQL_STREAM" | |
SELECT STREAM "s"."uniqueId", | |
LAG("s"."speed", 1, "s"."speed") OVER CURRENT_WINDOW AS "previousSpeed", | |
"s"."speed" AS "currentSpeed" | |
FROM "SPEED_SQL_STREAM" AS "s" | |
WINDOW CURRENT_WINDOW AS (PARTITION BY "s"."uniqueId" ROWS 3 PRECEDING); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment