1

我确信这句话在 Esper 中有效:

/* query from table TableA when receive event PriceEvent */
ON PriceEvent p
SELECT a.SymbolA, p.price
FROM TableA a
WHERE a.Symbol = p.Symbol

但是此语句会引发错误:

/* join table TableA with TableB */
ON PriceEvent p
SELECT a.SymbolA, p.price, b.SymbolB
FROM TableA a, TableB b
WHERE a.Key = b.Key and a.Symbol = p.Symbol

错误信息:

com.espertech.esper.client.EPStatementSyntaxException: Incorrect syntax near ',' expecting end-of-input but found a comma ','

然后我使用 JOIN 但它仍然不起作用:

/* join table TableA with TableB */
ON PriceEvent p
SELECT a.SymbolA, p.price, b.SymbolB
FROM TableA a inner join TableB b
ON a.Key = b.Key
WHERE a.Symbol = p.Symbol

错误信息:

Incorrect syntax near 'join' (a reserved keyword) expecting end-of-input but found 'join'

如何在 Esper 中连接两个表?

4

1 回答 1

1

on-select 只允许一个命名的窗口或表,而不是多个。连接只是“从 A、B、C...中选择 *”,您可以考虑使用“单向”。

于 2015-04-02T15:18:30.770 回答