我在DolphinDB数据库中有一个分区表。其中两列是符号和名称。每个符号对应一个唯一的名称。我需要从分区表中选择不同的符号和名称。
我使用了以下脚本
t0 = select distinct(Symbol) as Symbol from t order by Symbol
t0 = select Symbol, Name from lj(t0, t, `Symbol)
但收到以下错误消息:
execution was completed with exception
A regular left table can't perform left join (lj), sorted left join (slj), full join (fj), asof join (aj), or window join (pwj, wj) with another distributed or segmented table.
答案 0 :(得分:0)
对于您的情况,您可以通过平等联接来解决问题。在DolphinDB中,可以在常规表和分区表之间进行相等联接。
t0 = select distinct(Symbol) as Symbol from t order by Symbol
t0 = select Symbol, Name from ej(t0, t, `Symbol)
t0 = select * from t0 where prev(Symbol) ne Symbol