case when column = another column
I have a semi-complex query, and I'm trying to use a case() that includes a when() where the two values are columns (aka the two columns have the same value).
It doesn't seem to be supported, however in theory this should work. Any idea how I can make it work with Kysely?
The
.when("shahz_response", "=", "rank")
is where I'm attempting this, but this isn't working
Solution:Jump to solution
Welp, looks like I figured it out!
.when("shahz_response", "=", e.ref("rank"))
...1 Reply
Solution
Welp, looks like I figured it out!
.when("shahz_response", "=", e.ref("rank"))