count接口问题,报语法错误!!!
sanshao opened this issue · 1 comments
sanshao commented
ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' fund_id
= 2' at line 1 (code: ER_PARSE_ERROR)
let queryResult = await this.app.mysql.count('fund_lp_relation', {
where: {
status: 1,
fund_id: 2
}
});
let queryResult = await this.app.mysql.query(`SELECT COUNT(*) FROM fund_lp_relation WHERE status = 1 and fund_id = 2`)
上面2种写法都没毛病吧,但是用count接口就报如上错误
sanshao commented
果然还是写错 第2个参数没有where那层