Reconcile unmatched trades with one OUTER JOIN
curl -X POST https://oc-acme.ap-south-1.originchain.ai/v1/sql \
-H "Authorization: Bearer $OC_TOKEN" \
-H "Content-Type: application/json" \
-d '{"sql":"SELECT t.trade_id, t.symbol, t.qty FROM trades_executed t LEFT JOIN trades_confirmed c ON t.trade_id = c.confirm_id WHERE c.confirm_id IS NULL AND t.ts > now() - interval ''4 hours''"}' {
"rows": [
{ "trade_id": "T-91002", "symbol": "RELIANCE", "qty": 100 },
{ "trade_id": "T-91018", "symbol": "INFY", "qty": 250 }
],
"meta": { "latency_ms": 47, "rows_scanned": 184320 }
}