Skip to content

Instantly share code, notes, and snippets.

-- Fast SQL as-of join (Postgres version), contributed by Rand Merchant Bank e-Quant team
-- Kabelo Masemola, Paul Jacot-Guillarmod, Michael Stephanou
-- Rand Merchant Bank does not make any representations or give any warranties as to the correctness, accuracy or completeness of the included code; nor does Rand Merchant Bank assume liability for any losses arising from errors or omissions in the code.
-- Create tables
CREATE TABLE table1 ( time timestamptz, val double precision);
CREATE TABLE table2 ( time timestamptz, val double precision);
-- Create aggregate functions