1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-23 07:05:36 +03:00
mariadb-columnstore-engine/mysql-test/columnstore/basic/r/mcs187_dayofmonth_function.result

30 lines
831 B
Plaintext

DROP DATABASE IF EXISTS mcs187_db;
CREATE DATABASE mcs187_db;
USE mcs187_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', '1212-12-11 11:11:11'), ('3333-03-03', '3333-3-4 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 DAYOFMONTH('1212-12-12 11:11:11');
DAYOFMONTH('1212-12-12 11:11:11')
12
SELECT DAYOFMONTH('2020-12-22');
DAYOFMONTH('2020-12-22')
22
SELECT a, DAYOFMONTH(a) FROM t1 ORDER BY 1;
a DAYOFMONTH(a)
0000-00-00 0
1212-12-12 12
3333-03-03 3
SELECT b, DAYOFMONTH(b) FROM t1 ORDER BY 1;
b DAYOFMONTH(b)
0000-00-00 00:00:00 0
1212-12-11 11:11:11 11
3333-03-04 03:33:33 4
DROP DATABASE mcs187_db;