0
点赞
收藏
分享

微信扫一扫

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

_铁马冰河_ 2022-12-05 阅读 93

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里面加了双引号导致语法查询不出来

举报

相关推荐

0 条评论