select count(id) from UserInfo where bmi=19.72 and sex='F'
select count(id) from UserInfo where bmi='19.72' and sex='F'
,bmi是float类型的
数据库中明明有记录,就是查询不出来,是为什么啊?
select count(id) from userinfo where cast(bmi as unsigned) = cast(19.72 as unsigned) and sex='F'
select count(id) from UserInfo where bmi>=19.72 and bmi<19.73 and sex='F'
如果查不出来结果,那你的sex='F'的这个条件肯定有问题,你可以先把这个条件去掉试试