1
by brian
clean slate |
1 |
drop table if exists t1;
|
907.1.2
by Jay Pipes
Merging in old r902 temporal changes |
2 |
explain extended select makedate(1997,1), microsecond("1997-12-31 23:59:59.000001");
|
1
by brian
clean slate |
3 |
id select_type table type possible_keys key key_len ref rows filtered Extra
|
4 |
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL No tables used
|
|
5 |
Warnings:
|
|
907.1.2
by Jay Pipes
Merging in old r902 temporal changes |
6 |
Note 1003 select makedate(1997,1) AS `makedate(1997,1)`,microsecond('1997-12-31 23:59:59.000001') AS `microsecond("1997-12-31 23:59:59.000001")`
|
1
by brian
clean slate |
7 |
create table t1 (d date);
|
8 |
insert into t1 values ('2004-07-14'),('2005-07-14');
|
|
9 |
select date_format(d,"%d") from t1 order by 1;
|
|
10 |
date_format(d,"%d")
|
|
11 |
14
|
|
12 |
14
|
|
13 |
drop table t1;
|
|
14 |
create table t1 (f1 datetime);
|
|
15 |
insert into t1 (f1) values ("2005-01-01");
|
|
16 |
insert into t1 (f1) values ("2005-02-01");
|
|
17 |
select date_format(f1, "%m") as d1, date_format(f1, "%M") as d2 from t1 order by date_format(f1, "%M");
|
|
18 |
d1 d2
|
|
19 |
02 February
|
|
20 |
01 January
|
|
21 |
drop table t1;
|
|
22 |
SELECT TIME_FORMAT("24:00:00", '%r');
|
|
23 |
TIME_FORMAT("24:00:00", '%r')
|
|
24 |
12:00:00 AM
|
|
25 |
SELECT TIME_FORMAT("00:00:00", '%r');
|
|
26 |
TIME_FORMAT("00:00:00", '%r')
|
|
27 |
12:00:00 AM
|
|
28 |
SELECT TIME_FORMAT("12:00:00", '%r');
|
|
29 |
TIME_FORMAT("12:00:00", '%r')
|
|
30 |
12:00:00 PM
|
|
31 |
SELECT TIME_FORMAT("15:00:00", '%r');
|
|
32 |
TIME_FORMAT("15:00:00", '%r')
|
|
33 |
03:00:00 PM
|
|
34 |
SELECT TIME_FORMAT("01:00:00", '%r');
|
|
35 |
TIME_FORMAT("01:00:00", '%r')
|
|
36 |
01:00:00 AM
|
|
37 |
SELECT TIME_FORMAT("25:00:00", '%r');
|
|
38 |
TIME_FORMAT("25:00:00", '%r')
|
|
39 |
01:00:00 AM
|
|
40 |
SELECT TIME_FORMAT("00:00:00", '%l %p');
|
|
41 |
TIME_FORMAT("00:00:00", '%l %p')
|
|
42 |
12 AM
|
|
43 |
SELECT TIME_FORMAT("01:00:00", '%l %p');
|
|
44 |
TIME_FORMAT("01:00:00", '%l %p')
|
|
45 |
1 AM
|
|
46 |
SELECT TIME_FORMAT("12:00:00", '%l %p');
|
|
47 |
TIME_FORMAT("12:00:00", '%l %p')
|
|
48 |
12 PM
|
|
49 |
SELECT TIME_FORMAT("23:00:00", '%l %p');
|
|
50 |
TIME_FORMAT("23:00:00", '%l %p')
|
|
51 |
11 PM
|
|
52 |
SELECT TIME_FORMAT("24:00:00", '%l %p');
|
|
53 |
TIME_FORMAT("24:00:00", '%l %p')
|
|
54 |
12 AM
|
|
55 |
SELECT TIME_FORMAT("25:00:00", '%l %p');
|
|
56 |
TIME_FORMAT("25:00:00", '%l %p')
|
|
57 |
1 AM
|
|
58 |
SELECT DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896);
|
|
59 |
DATE_FORMAT('%Y-%m-%d %H:%i:%s', 1151414896)
|
|
60 |
NULL
|
|
61 |
Warnings:
|
|
62 |
Warning 1292 Incorrect datetime value: '%Y-%m-%d %H:%i:%s'
|
|
63 |
"End of 4.1 tests"
|