1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-20 09:07:44 +03:00

30 lines
851 B
Plaintext

DROP DATABASE IF EXISTS mcs183_db;
CREATE DATABASE mcs183_db;
USE mcs183_db;
SET default_storage_engine=Columnstore;
CREATE TABLE t1 (a DATE, b DATETIME);
INSERT INTO t1 VALUES ('0-0-0', '0-0-0 0:0:0'), ('1212-12-12', '1111-11-11 11:11:11'), ('3333-03-03', '3333-3-3 3:33:33');
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` date DEFAULT NULL,
`b` datetime DEFAULT NULL
) ENGINE=Columnstore DEFAULT CHARSET=latin1
SELECT DATE('1212-12-12 11:11:11');
DATE('1212-12-12 11:11:11')
1212-12-12
SELECT DATE('2020-12-22');
DATE('2020-12-22')
2020-12-22
SELECT a, DATE(a) FROM t1 ORDER BY 1;
a DATE(a)
0000-00-00 0000-00-00
1212-12-12 1212-12-12
3333-03-03 3333-03-03
SELECT b, DATE(b) FROM t1 ORDER BY 1;
b DATE(b)
0000-00-00 00:00:00 0000-00-00
1111-11-11 11:11:11 1111-11-11
3333-03-03 03:33:33 3333-03-03
DROP DATABASE mcs183_db;