CREATETABLE customers (
id INTPRIMARYKEYNOT ENFORCED,
name STRING,
country STRING,
zip STRING
);INSERTINTO
customers
VALUES(1,'zs','ch','123'),(2,'ls','ch','456'),(3,'ww','ch','789');CREATETEMPORARYTABLE Orders (
order_id INT,
total INT,
customer_id INT,
proc_time AS PROCTIME())WITH('connector'='datagen','rows-per-second'='1','fields.order_id.kind'='sequence','fields.order_id.start'='1','fields.order_id.end'='100000','fields.total.kind'='random','fields.total.min'='1','fields.total.max'='1000','fields.customer_id.kind'='random','fields.customer_id.min'='1','fields.customer_id.max'='3');SELECT
o.order_id,
o.total,
c.country,
c.zip
FROM
Orders AS o
JOIN customers
FOR SYSTEM_TIME ASOF o.proc_time AS c
ON o.customer_id = c.id;