Skip to content
Advertisement

How to add if statement in knex.select()?

I have code like this

what I want is somehow select that column if it meets condition of attr and if does not then do select nothing. Something like:

Advertisement

Answer

You can assign the selection on other variable and then pass it to kenx.select.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement