You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE TABLE test(fla FLOAT,flb FLOAT,dba DOUBLE(10,2),dbb DOUBLE(10,2));
We have a table like this:
+-------+-------------+
| Field | Type |
+-------+-------------+
| fla | float |
| flb | float |
| dba | double(10,2)|
| dbb | double(10,2)|
+-------+-------------+
For first difference, we try to insert a record with '1.2' to each field:
INSERT INTO test values (1.2,1.2,1.2,1.2);
The table showing like this:
Perhaps this example could explain.
CREATE TABLE
test
(fla
FLOAT,flb
FLOAT,dba
DOUBLE(10,2),dbb
DOUBLE(10,2));We have a table like this:
+-------+-------------+
| Field | Type |
+-------+-------------+
| fla | float |
| flb | float |
| dba | double(10,2)|
| dbb | double(10,2)|
+-------+-------------+
For first difference, we try to insert a record with '1.2' to each field:
INSERT INTO
test
values (1.2,1.2,1.2,1.2);The table showing like this:
SELECT * FROM
test
;+------+------+------+------+
| fla | flb | dba | dbb |
+------+------+------+------+
| 1.2 | 1.2 | 1.20 | 1.20 |
+------+------+------+------+
See the difference?
We try to next example:
SELECT fla+flb, dba+dbb FROM
test
;Hola! We can find the difference like this:
+--------------------+---------+
| fla+flb | dba+dbb |
+--------------------+---------+
| 2.4000000953674316 | 2.40 |
+--------------------+---------+
Source: https://stackoverflow.com/a/28511784/676479
The text was updated successfully, but these errors were encountered: