Q/Kdb: 合并两列以创建一个新列作为列表

Q/Kdb: Combining two columns to create a new column as list

我需要帮助使用两个预先存在的列创建一个新列作为列表

CcyPair, Amount1, Amount2 
USDJPY   1666     2400
EURUSD   2344     3000

我想要新的输出

CcyPair, Amount1, Amount2, NewAmount
USDJPY   1666     2400     1666 2400
EURUSD   2344     3000     2344 3000

我试过 Select CcyPair,金额 1,金额 2,新金额:(金额 1;金额 2) 来自 table

但得到长度错误

关于如何解决这个问题的任何想法。 谢谢

我认为更新语句就是您想要的。

尝试:

update NewAmount:flip(Amount1;Amount2) from table

您可以在此处阅读有关更新语句的更多信息: https://code.kx.com/q4m3/9_Queries_q-sql/#95-the-update-template

您应该使用 ,' 运算符,其工作方式类似于 "pairwise" 追加。 请注意,在 updateselect 语句中,它必须用括号括起来,否则逗号将被 q-slq

误解
t: ([]CcyPair: `USDJPY`EURUSD; Amount1: 1666 2344; Amount2: 2400 3000);
t: update NewAmount: (Amount1,'Amount2) from t;
t