Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

在dolphindb database中,有个代码如下:

t1= table(1 2 3 3 6 as time, 1.1 2.1 3.1 3.1 6.1  as value)
t2 = table(5 3 1 as time,  5.1 3.1 1.1 as qty)
fj(t1, t2, `time)

fj后的结果如下:

time    value    t2_time    qty
1        1.1        1        1.1
2        2.1        
3        3.1        3        3.1
3        3.1        3        3.1
6        6.1        
                    5        5.1

我想得到如下结果:

time    value    qty
1        1.1        1.1
2        2.1    
3        3.1        3.1
3        3.1        3.1
5                   5.1
6        6.1    

代码应该怎么写?谢谢!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
932 views
Welcome To Ask or Share your Answers For Others

1 Answer

可以用下面代码:

select  nullFill(t1.time, t2.time) as time, value, qty from fj(t1, t2, `time) order by nullFill!(t1.time, t2.time)

或者

(select  nullFill(t1.time, t2.time) as time, value, qty from fj(t1, t2, `time)).sortBy!(`time)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...