Results of 1 - 1 of about 1 for ticker (0.001 sec.)
- AsOf Join 9414
- What is an AsOf Join? Time series data is not always perfectly aligned. Clocks may be slightly off, or there may be a delay between cause and effect. This can make connecting two sets of ordered data challenging. AsOf joins are a tool for s
...L. Portfolio Example Dataset Let's start with a concrete example. Suppose we have a table of stock prices with timestamps: ticker when price APPL 2001-01-01 00:00:00 1 APPL 2001-01-01 00:01:00 2 APPL 2001-01-01 00:02:00 3 MSFT 2001-01-01 00:00:00 1 MSF...01-01 00:01:00 2 GOOG 2001-01-01 00:02:00 3 We have another table containing portfolio holdings at various points in time: ticker when shares APPL 2000-12-31 23:59:30 5.16 APPL 2001-01-01 00:00:30 2.94 APPL 2001-01-01 00:01:30 24.13 GOOG 2000-12-31 23:...ding at that point in time by finding the most recent price before the holding's timestamp by using an AsOf Join: SELECT h.ticker, h.when, price * shares AS value FROM holdings h ASOF JOIN prices p ON h.ticker = p.ticker AND h.when >= p.when; This atta... - https://man.mtool.work/duckdb/2.0/guides/sql_features/asof_join.html
PREV
1
NEXT
DuckDB 2.0 Documentation / man.mtool.work