KDB / Q: Why did I get a length error when selecting data using a vector condition for a list of characters?

I have a table:

t3:([]a:2 3 4;b:`CA`AB`)

I have a request:

select from t3 where b in ?[a=2;`CA`AB;`AB]

Bong ... he gives me a length error.

But these works:

select from t3 where b in ?[a=2;`CA;`AB] 

select from t3 where b in `CA`AB

Can't think where it goes wrong? Please help ... Thanks.

+4
source share
1 answer

The length error is caused by the use of lists of different lengths in a conditional conditional expression - for more details see http://code.kx.com/q/ref/lists/#vector-conditional . Your other expression works because the two output arguments are atomic.

+2
source

Source: https://habr.com/ru/post/1658889/


All Articles