1
SELECT DAYOFYEAR(NULL);
5
ERROR 42000: Incorrect parameter count in the call to native function 'DAYOFYEAR'
6
SELECT DAYOFYEAR(1, 0);
7
ERROR 42000: Incorrect parameter count in the call to native function 'DAYOFYEAR'
8
SELECT DAYOFYEAR("xxx");
9
ERROR HY000: Received an invalid datetime value 'xxx'.
10
SELECT DAYOFYEAR("0000-00-00");
11
ERROR HY000: Received an invalid datetime value '0000-00-00'.
12
SELECT DAYOFYEAR("0000-01-01");
13
ERROR HY000: Received an invalid datetime value '0000-01-01'.
14
SELECT DAYOFYEAR("0001-00-01");
15
ERROR HY000: Received an invalid datetime value '0001-00-01'.
16
SELECT DAYOFYEAR("0001-01-00");
17
ERROR HY000: Received an invalid datetime value '0001-01-00'.
18
SELECT DAYOFYEAR("2000-02-30");
19
ERROR HY000: Received an invalid datetime value '2000-02-30'.
20
SELECT DAYOFYEAR("1900-02-29");
21
ERROR HY000: Received an invalid datetime value '1900-02-29'.
22
SELECT DAYOFYEAR('1976-15-15');
23
ERROR HY000: Received an invalid datetime value '1976-15-15'.
24
SELECT DAYOFYEAR("2009-01-01");
25
DAYOFYEAR("2009-01-01")
27
SELECT DAYOFYEAR("2009-01-12");
28
DAYOFYEAR("2009-01-12")
30
SELECT DAYOFYEAR("70-12-31");
33
SELECT DAYOFYEAR("00-12-31");
36
SELECT DAYOFYEAR("0001-01-31");
37
DAYOFYEAR("0001-01-31")
39
SELECT DAYOFYEAR('07/31/2009');
40
DAYOFYEAR('07/31/2009')
42
SELECT DAYOFYEAR('20090916');
45
SELECT DAYOFYEAR('20090916091528');
46
DAYOFYEAR('20090916091528')
48
SELECT DAYOFYEAR("20090916091528.000000");
49
DAYOFYEAR("20090916091528.000000")
51
SELECT DAYOFYEAR('09-09-16');
54
SELECT DAYOFYEAR('09.09.16');
57
SELECT DAYOFYEAR('09/09/16');
60
SELECT DAYOFYEAR('09-09-16');
63
SELECT DAYOFYEAR('09-9-2');
66
SELECT DAYOFYEAR(20090916);
69
SELECT DAYOFYEAR(20090916091528);
70
DAYOFYEAR(20090916091528)
72
SELECT DAYOFYEAR(20090916091528.000000);
73
ERROR HY000: Received an invalid datetime value '20090916091528.000000'.
75
DROP TABLE IF EXISTS t1;
78
, date_fld DATE NOT NULL
79
, datetime_fld DATETIME NOT NULL
80
, timestamp_fld TIMESTAMP NOT NULL
81
, char_fld CHAR(22) NOT NULL
82
, varchar_fld VARCHAR(22) NOT NULL
83
, text_fld TEXT NOT NULL
84
, blob_fld BLOB NOT NULL
86
INSERT INTO t1 VALUES (
89
, "2007-11-30 16:30:19"
90
, "2007-11-30T16:30:19"
91
, "2007-11-30 16:30:19"
92
, "2007-11-30 16:30:19"
93
, "2007-11-30T16:30:19"
94
, "2007-11-30T16:30:19"
96
SELECT DAYOFYEAR(int_fld) FROM t1;
99
SELECT DAYOFYEAR(date_fld) FROM t1;
102
SELECT DAYOFYEAR(datetime_fld) FROM t1;
103
DAYOFYEAR(datetime_fld)
105
SELECT DAYOFYEAR(timestamp_fld) FROM t1;
106
DAYOFYEAR(timestamp_fld)
108
SELECT DAYOFYEAR(char_fld) FROM t1;
111
SELECT DAYOFYEAR(varchar_fld) FROM t1;
112
DAYOFYEAR(varchar_fld)
114
SELECT DAYOFYEAR(text_fld) FROM t1;
117
SELECT DAYOFYEAR(blob_fld) FROM t1;