2021.12.06 01:08 PM
t:([x:(1 2 3);y:(`x`y`z)]z:"abc")
l:`x`y`z!(2;`y;"b")
select from t where (2#l) ~/:flip value flip key t
Shouldnt the above code be showing the second row in table? instead i get nothing back.
Solved! Go to Solution.
2021.12.06 02:47 PM
Take a look at what each part of the where clause looks like:
// this is a dictionary
q)2#l
x| 2
y| `y
// and this is a nested list of your x and y columns with no rows matching above
q)flip value flip key t
1 `x
2 `y
3 `z
To correct, just key t
q)select from t where (2#l) ~/: key t
x y| z
---| -
2 y| b
2021.12.06 02:47 PM
Take a look at what each part of the where clause looks like:
// this is a dictionary
q)2#l
x| 2
y| `y
// and this is a nested list of your x and y columns with no rows matching above
q)flip value flip key t
1 `x
2 `y
3 `z
To correct, just key t
q)select from t where (2#l) ~/: key t
x y| z
---| -
2 y| b
2021.12.07 05:51 AM
Thank you! this worked
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.