mysql 查询 in 导致数据出不来换成between and 就可以了


select count(1) as total from rights, lender where rights.loan_id in (25707,25708,25718)  and rightss.state IN (0,1,2,3,4,6) and lender.id= rights.lender_id and from_rights_id=  0;

select count(1) as total from rights, lender where rights.loan_id between 25707 and 25718  and rights.state IN (0,1,2,3,4,6) and lender.id= rights.lender_id and from_rights_id=  0;

其实根本的原因是在in里面加了双引号导致语法查询不出来

你可能感兴趣的:(mysql)