Repository navigation
Sequelize query data between columns #15290
Unanswered
EmmanJayDizon
asked this question in
Help & Questions
Replies: 1 comment 5 replies
|
This should work: import { where, Op, col } from 'sequelize';
YourModel.findAll({
where: and(
where(10000, Op.between, [col("minAmount"), col("maxAmount")]),
where(30, Op.between, [col("minDay"), col("maxDay")])
)
}); |
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Is this possible on sequelize query without using raw query ? ->
SELECT *
FROM tablename
WHERE 10000 BETWEEN "minAmount" AND "maxAmount"
AND 30 BETWEEN "minDay" AND "maxDay"
All reactions