1.问题
表A某字段类型为float类型,当根据该字段的值进行精确查询时,按照SQL惯用语句查询如下:
select * from abalone
where sex = 2 and length = 0.27
我们会发现,虽然数据库中存在此值,但是查询结果为空。
2.解决办法
根据网上查到的办法:使用like进行查询
select * from abalone
where sex = 2 and length like 0.27
1.问题
表A某字段类型为float类型,当根据该字段的值进行精确查询时,按照SQL惯用语句查询如下:
select * from abalone
where sex = 2 and length = 0.27
我们会发现,虽然数据库中存在此值,但是查询结果为空。
2.解决办法
根据网上查到的办法:使用like进行查询
select * from abalone
where sex = 2 and length like 0.27