📅  最后修改于: 2022-03-11 14:56:10.985000             🧑  作者: Mango
knex('users')
.select(knex.raw('count(*) as user_count, status'))
.where(knex.raw(1))
.orWhere(knex.raw('status <> ?', [1]))
.groupBy('status')Outputs:select count(*) as user_count, status from `users` where 1 or status <> 1 group by `status`