type_time.result
上传用户:romrleung
上传日期:2022-05-23
资源大小:18897k
文件大小:2k
- drop table if exists t1;
- create table t1 (t time);
- insert into t1 values("10:22:33"),("12:34:56.78"),(10),(1234),(123456.78),(1234559.99),("1"),("1:23"),("1:23:45"), ("10.22"), ("-10 1:22:33.45"),("20 10:22:33"),("1999-02-03 20:33:34");
- insert t1 values (30),(1230),("1230"),("12:30"),("12:30:35"),("1 12:30:31.32");
- select * from t1;
- t
- 10:22:33
- 12:34:56
- 00:00:10
- 00:12:34
- 12:34:56
- 123:45:59
- 00:00:01
- 01:23:00
- 01:23:45
- 00:00:10
- -241:22:33
- 490:22:33
- 20:33:34
- 00:00:30
- 00:12:30
- 00:12:30
- 12:30:00
- 12:30:35
- 36:30:31
- insert into t1 values("10.22.22"),(1234567),(123456789),(123456789.10),("10 22:22"),("12.45a");
- Warnings:
- Warning 1265 Data truncated for column 't' at row 1
- Warning 1264 Data truncated; out of range for column 't' at row 2
- Warning 1264 Data truncated; out of range for column 't' at row 3
- Warning 1264 Data truncated; out of range for column 't' at row 4
- Warning 1265 Data truncated for column 't' at row 6
- select * from t1;
- t
- 10:22:33
- 12:34:56
- 00:00:10
- 00:12:34
- 12:34:56
- 123:45:59
- 00:00:01
- 01:23:00
- 01:23:45
- 00:00:10
- -241:22:33
- 490:22:33
- 20:33:34
- 00:00:30
- 00:12:30
- 00:12:30
- 12:30:00
- 12:30:35
- 36:30:31
- 00:00:10
- 00:00:00
- 838:59:59
- 838:59:59
- 262:22:00
- 00:00:12
- drop table t1;
- create table t1 (t time);
- insert into t1 values ('09:00:00'),('13:00:00'),('19:38:34'), ('13:00:00'),('09:00:00'),('09:00:00'),('13:00:00'),('13:00:00'),('13:00:00'),('09:00:00');
- select t, time_to_sec(t),sec_to_time(time_to_sec(t)) from t1;
- t time_to_sec(t) sec_to_time(time_to_sec(t))
- 09:00:00 32400 09:00:00
- 13:00:00 46800 13:00:00
- 19:38:34 70714 19:38:34
- 13:00:00 46800 13:00:00
- 09:00:00 32400 09:00:00
- 09:00:00 32400 09:00:00
- 13:00:00 46800 13:00:00
- 13:00:00 46800 13:00:00
- 13:00:00 46800 13:00:00
- 09:00:00 32400 09:00:00
- select sec_to_time(time_to_sec(t)) from t1;
- sec_to_time(time_to_sec(t))
- 09:00:00
- 13:00:00
- 19:38:34
- 13:00:00
- 09:00:00
- 09:00:00
- 13:00:00
- 13:00:00
- 13:00:00
- 09:00:00
- drop table t1;