在mysql中存入一个时间值的sql语句怎么写?
来源:百度知道 编辑:UC知道 时间:2024/06/14 03:30:28
在mysql中存入一个时间值的sql语句怎么写?
通常,把数据库字段,设置为INT
时间用time()来保存进去,在显示的地方用date()来处理,这样子在以后的操作非常方便
create table test(d datetime);
insert into test(d)values(current_timestamp);
select * from test;