如何在KDB中的每一行应用max函数?

mch*_*hen 6 kdb q-lang

我想确保列x中的所有值都不小于0.5,所以我这样做:

update x:max (x 0.5) from myTable
Run Code Online (Sandbox Code Playgroud)

但这会产生错误(在Studio For KDB +中):

An error occurred during execution of the query.
The server sent the response:
type
Studio Hint: Possibly this error refers to wrong type, e.g `a+1
Run Code Online (Sandbox Code Playgroud)

怎么了?

小智 8

您可以尝试使用|

q)update x|0.5 from myTable
Run Code Online (Sandbox Code Playgroud)