简体   繁体   中英

How to get all data using month only

SELECT * FROM `EVENT` WHERE MONTH(START_DATE) = 7 AND YEAR(START_DATE) = 2019

如何在与nodejs的sequelize中使用此查询?

You can use range operators such as $gte , $lte , $gt , $lt :

model.findAll({
   where: {
     start_date: {
       '$gte': new Date("2019-07-01")
     }
   }
})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM