Clean way to do conditional statement in SQL?

https://learninghub.kx.com/forums/topic/clean-way-to-do-conditional-statement-in-sql

I was wondering what the best way to do conditional update in q? I know i can do the below but wondering if theres a shorter/cleaner way.

t:flip `a`b!(1 2;01b) update c:{$[x;`true;`false]} each b from t

 

 

 

update c:?[b;`true;`false] from t

exactly what i was looking for! thank you

Hi @ekallivrousis, try using a vector conditional - https://code.kx.com/q/ref/vector-conditional/

update c:?[b;`true;`false] from t

b = vector of booleans being passed in