我有下表:
+------------+--------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+--------+------+-----+---------+----------------+
| id | double | NO | PRI | NULL | auto_increment |
| az1 | float | YES | | 989898 | |
| el1 | float | YES | | 989898 | |
| az2 | float | YES | | 989898 | |
| el2 | float | YES | | 989898 | |
| rfs_angle | float | YES | | 989898 | |
| scan_speed | float | YES | | 989898 | |
+------------+--------+------+-----+---------+----------------+
我插入此数据超过 100 次
INSERT INTO lidar_traj_table (az1, el1, az2, el2, rfs_angle, scan_speed) VALUES (49.100, 0.000,989898,8.000,1.0,1.000)
当我尝试选择数据时,我什么也没收到:
SELECT * FROM lidar_traj_table WHERE az1=49.1
当我选择比 49.1 更小的数据时,我得到了所有行
SELECT * FROM lidar_traj_table WHERE az1<=49.1
为什么我得到的结果是空的:
SELECT * FROM lidar_traj_table WHERE az1=49.1
如果你想存储精确的值,那么你应该使用
DECIMAL
数据类型而不是FLOAT
.