Here is my raw SQL
:
UPDATE
"RESULT"
SET
result_last_clicks = result_clicks;
I can use knex.raw(sql)
to do this.
How can I do this by using knex('RESULT').update({result_last_clicks: ??.result_clicks})
update
environments:
"knex": "^0.15.2"
This is pretty much of a duplicate of e.g. Knex.js - How To Update a Field With An Expression
Though with latest knex you can use column reference helper instead of knex.raw
:
knex('RESULT').update({
result_last_clicks: knex.ref('result_clicks')
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With