5
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near ')' at line 1
7
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near ' 0)' at line 1
9
ERROR HY000: Received an invalid datetime value 'xxx'.
10
SELECT YEAR("0000-00-00");
11
ERROR HY000: Received an invalid datetime value '0000-00-00'.
12
SELECT YEAR("0000-01-01");
13
ERROR HY000: Received an invalid datetime value '0000-01-01'.
14
SELECT YEAR("0001-00-01");
15
ERROR HY000: Received an invalid datetime value '0001-00-01'.
16
SELECT YEAR("0001-01-00");
17
ERROR HY000: Received an invalid datetime value '0001-01-00'.
18
SELECT YEAR("2000-02-30");
19
ERROR HY000: Received an invalid datetime value '2000-02-30'.
20
SELECT YEAR("1900-02-29");
21
ERROR HY000: Received an invalid datetime value '1900-02-29'.
22
SELECT YEAR('1976-15-15');
23
ERROR HY000: Received an invalid datetime value '1976-15-15'.
24
SELECT YEAR("2009-01-12");
27
SELECT YEAR("70-12-31");
30
SELECT YEAR("99-12-31");
33
SELECT YEAR("69-12-31");
36
SELECT YEAR("0001-12-31");
39
SELECT YEAR("9999-12-31");
42
SELECT YEAR('07/31/2009');
45
SELECT YEAR('20090916');
48
SELECT YEAR('20090916091528');
49
YEAR('20090916091528')
51
SELECT YEAR("20090916091528.000000");
52
YEAR("20090916091528.000000")
54
SELECT YEAR('09-09-16');
57
SELECT YEAR('09.09.16');
60
SELECT YEAR('09/09/16');
63
SELECT YEAR('09-09-16');
66
SELECT YEAR('09-9-2');
69
SELECT YEAR(20090916);
72
SELECT YEAR(20090916091528);
75
SELECT YEAR(20090916091528.000000);
76
ERROR HY000: Received an invalid datetime value '20090916091528.000000'.
78
DROP TABLE IF EXISTS t1;
81
, date_fld DATE NOT NULL
82
, datetime_fld DATETIME NOT NULL
83
, timestamp_fld TIMESTAMP NOT NULL
84
, char_fld CHAR(22) NOT NULL
85
, varchar_fld VARCHAR(22) NOT NULL
86
, text_fld TEXT NOT NULL
87
, blob_fld BLOB NOT NULL
89
INSERT INTO t1 VALUES (
92
, "2007-11-30 16:30:19"
93
, "2007-11-30T16:30:19"
94
, "2007-11-30 16:30:19"
95
, "2007-11-30 16:30:19"
96
, "2007-11-30T16:30:19"
97
, "2007-11-30T16:30:19"
99
SELECT YEAR(int_fld) FROM t1;
102
SELECT YEAR(date_fld) FROM t1;
105
SELECT YEAR(datetime_fld) FROM t1;
108
SELECT YEAR(timestamp_fld) FROM t1;
111
SELECT YEAR(char_fld) FROM t1;
114
SELECT YEAR(varchar_fld) FROM t1;
117
SELECT YEAR(text_fld) FROM t1;
120
SELECT YEAR(blob_fld) FROM t1;