You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following example performs an ASOF LEFT JOIN, returning all trade records along with the latest quote before or at the trade time for the same symbol, if such a quote exists. If no matching quote exists, the quote fields will be NULL.
479
+
480
+
```sql
481
+
SELECT*
482
+
FROM trades
483
+
ASOF LEFT JOIN quotes
484
+
ONtrades.symbol=quotes.symbol
485
+
ANDtrades.time>=quotes.time;
486
+
```
487
+
488
+
For the definitions of the tables in the example, see [Example Tables](#example-tables).
The following example performs an ASOF RIGHT JOIN, returning all quote records along with the latest trade after or at the quote time for the same symbol, if such a trade exists. If no matching trade exists, the trade fields will be NULL.
500
+
501
+
```sql
502
+
SELECT*
503
+
FROM trades
504
+
ASOF RIGHT JOIN quotes
505
+
ONtrades.symbol=quotes.symbol
506
+
ANDtrades.time>=quotes.time;
507
+
```
508
+
509
+
For the definitions of the tables in the example, see [Example Tables](#example-tables).
0 commit comments