简化多个更新语句 - KDB

0 kdb

我有一个包含多个标志的表,我想将这些标志映射到它们所代表的值.

tab:([] t:til 4 ; f1:1100b;f2:1010b;f3:0101b;f4:0011b )
Run Code Online (Sandbox Code Playgroud)

如何简化这些多个更新语句?

tab:update f1s:`googl from tab where f1
tab:update f2s:`appl from tab where f2
tab:update f3s:`amzn from tab where f3
Run Code Online (Sandbox Code Playgroud)

小智 5

update f1s:``googl f1,f2s:``appl f2,f3s:``amzn f3 from `tab

您可以将符号放在列表中,并使用布尔值将其编入索引