lifeofthenoobie
lifeofthenoobie

Reputation: 169

Where I should put time travel timestamp

I have a query like

SELECT Table1.MTH_COD, Table1.ID, Table1.ETV_FLG,Table2.EXT_FLG, Table2.GEN_COD, Table3.AMOUNT_VALUE, Table3.CUR_IDT_COD as "Table3.CUR_IDT_COD"
from "Database"."Schema"."Table" as Table1 
    JOIN "Database"."Schema"."Table" as Table2
        ON Table1.MTH_COD=Table2.MTH_COD
        AND Table1.ID=Table2.ID
 LEFT JOIN "Database"."Schema"."Table" as Table3
ON Table1.MTH_COD=Table3.MTH_COD
AND Table1.GRADE_COD=Table3.GRADE_COD
        WHERE Table1.CLASS_COD IS DISTINCT FROM (select CLASS_COD_ID from "Database"."Schema"."ReferentialTable" 
                                     where CLASS_COD = 'DE')
        AND EXT_FLG = 0

I want to add here at(timestamp => '2022-08-25 12:00:00'::timestamp), but Ive tried several times and cannot insert it appropriately

Upvotes: 0

Views: 144

Answers (1)

Dean Flinter
Dean Flinter

Reputation: 664

Put it after any table name but before any alias

E.g.

FROM table1 at(timestamp => '2022-08-25 12:00:00'::timestamp) as mytable
JOIN table2 at(timestamp => '2022-08-25 12:00:00'::timestamp) on...

Upvotes: 1

Related Questions