How could I do this query using Sequelize?
SELECT t1.* FROM Table1 t1 inner join Table2 t2 on t1.id != t2.t1_id
How could I do this query using Sequelize?
SELECT t1.* FROM Table1 t1 inner join Table2 t2 on t1.id != t2.t1_id
You can do a raw query and keep this SQL you already have. According to documentation you can do this with sequelize.query
:
sequelize.query("SELECT t1.* FROM Table1 t1 inner join Table2 t2 on t1.id != t2.t1_id", { type: sequelize.QueryTypes.SELECT})
.then(function(results) {
// aqui podes usar o results
})