2

I have the following table:

+------------+--------+------+-----+---------+----------------+
| 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  |                |
+------------+--------+------+-----+---------+----------------+

I inserted this data more than 100times

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)

When I'm trying to select the data I'm receiving nothing:

SELECT * FROM lidar_traj_table WHERE az1=49.1

When I'm selecting smaller data then 49.1 than I get all the rows

SELECT * FROM lidar_traj_table WHERE az1<=49.1

Why am I getting empty result for this:

SELECT * FROM lidar_traj_table WHERE az1=49.1
4

If you want to store exact values then you should use the DECIMAL data type instead of FLOAT.

| improve this answer | |
  • Looks like a comment, but a powerful answer. +1 !!! – RolandoMySQLDBA Jan 9 '13 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.