我试着用sequelize把table弄乱,但我不知道怎么做。
SELECT count(*) as counts FROM (SELECT * FROM board order by id desc limit 10) as board WHERE board.login_id = 1234
如何在sequelize中表示这一点
yebdmbv41#
你可以在续集里这样做。
//board means your model name let result = await board.count({ order: [sequelize.literal('id DESC')], limit: 10, where: { login_id: 1234 }, as: 'board' })
1条答案
按热度按时间yebdmbv41#
你可以在续集里这样做。