Mysql查询:
SELECT * FROM顾问产品范围WHERE 5介于从范围和到范围之间;
如何以sequelize格式复制相同内容
const AdvisorProductRangeDataGdp = await AdvisorProductRange.findAll({
attributes: ['office_id','yyyymmdd','product_type','from_range','to_range','amount_per_order'],
where: {
from_range: {
[dbOp.gte]: gdpCount
},
to_range: {
[dbOp.lte]: gdpCount
}
}
});
此查询在MySQL术语中的输出:
> SELECT `office_id`, `yyyymmdd`, `product_type`, `from_range`,
> `to_range`, `amount_per_order` FROM `advisor_product_range` AS
> `AdvisorProductRange` WHERE `AdvisorProductRange`.`from_range` <= 5 AND
> `AdvisorProductRange`.`to_range` >= 5;
Mysql表结构:
版本:续集:5.8
1条答案
按热度按时间nue99wik1#