type_time.result

来自「这是linux下运行的mysql软件包,可用于linux 下安装 php + m」· RESULT 代码 · 共 88 行

RESULT
88
字号
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;t10:22:3312:34:5600:00:1000:12:3412:34:56123:45:5900:00:0101:23:0001:23:4500:00:10-241:22:33490:22:3320:33:3400:00:3000:12:3000:12:3012:30:0012:30:3536:30:31insert 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 1Warning	1264	Out of range value adjusted for column 't' at row 2Warning	1264	Out of range value adjusted for column 't' at row 3Warning	1264	Out of range value adjusted for column 't' at row 4Warning	1265	Data truncated for column 't' at row 6select * from t1;t10:22:3312:34:5600:00:1000:12:3412:34:56123:45:5900:00:0101:23:0001:23:4500:00:10-241:22:33490:22:3320:33:3400:00:3000:12:3000:12:3012:30:0012:30:3536:30:3100:00:1000:00:00838:59:59838:59:59262:22:0000:00:12drop 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:0013:00:00	46800	13:00:0019:38:34	70714	19:38:3413:00:00	46800	13:00:0009:00:00	32400	09:00:0009:00:00	32400	09:00:0013:00:00	46800	13:00:0013:00:00	46800	13:00:0013:00:00	46800	13:00:0009:00:00	32400	09:00:00select sec_to_time(time_to_sec(t)) from t1;sec_to_time(time_to_sec(t))09:00:0013:00:0019:38:3413:00:0009:00:0009:00:0013:00:0013:00:0013:00:0009:00:00drop table t1;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?