Knex Join Limit Query

I'm using node.js and knexjs

I need to make an SQL request like:

SELECT * FROM (SELECT * FROM t LIMIT 50 OFFSET 0) AS t1
JOIN t2 ON t2.t_id = t1.id

Is it possible to make it with knex query builder?

1

1 Answer

knex({ 
  t1: knex('t').limit(50).offset(0) 
}).join('t2', 't2.t_id', 't1.id')
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest