|
CREATE OR REPLACE TABLE t1 (a date);
|
CREATE OR REPLACE TABLE t2 AS SELECT FLOOR(a), CEIL(a),ROUND(a),TRUNCATE(a,0) FROM t1;
|
+---------------+--------------+------+-----+---------+-------+
|
| Field | Type | Null | Key | Default | Extra |
|
+---------------+--------------+------+-----+---------+-------+
|
| FLOOR(a) | bigint(12) | YES | | NULL | |
|
| CEIL(a) | bigint(12) | YES | | NULL | |
|
| ROUND(a) | double(17,0) | YES | | NULL | |
|
| TRUNCATE(a,0) | double(17,0) | YES | | NULL | |
|
+---------------+--------------+------+-----+---------+-------+
|
A date value has 8 digits in numeric format: YYYYMMDD.
- INT(9) should be enough for ROUND() with a negative argument (to be checked in a separate MDEV)
- INT(8) should be enough for ROUND() with a non-negative argument
- INT(8) should be enough for all other functions
|