Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这个基本条件有效:
$[8i > 3i ; true;false]
但这不会:
$[mm$.z.d > 3i ; true;false]
我不明白为什么,因为mm$.z.d (current month)是8i。
mm$.z.d (current month)
8i
kdb 从右到左读取,因此它在比较
.z.d>3i
在它到达月份铸造之前。您需要先使用括号强制强制转换
q)$[(`mm$.z.d) > 3i ;`true;`false] `true
或者更好的是,重构您的语句以允许从右到左
q)$[3i<`mm$.z.d;`true;`false] `true