我尝试以这种方式创建一个表:
create table attendance (
userId char(10) primary key not null,
name varchar(35) not null,
date_attendance date not null,
start_time timestamp 'HH24:MI:SS',
finish_time timestamp 'HH24:MI:SS'
);
我以这种方式创建时间字段是否正确,或者有更好的选择吗?
最佳答案
这是非常正确的,您可以做的一件事是,在提供设置为非空的日期时,您还可以通过向其分配 getDate 或 getUTcDate() 函数来为其提供默认日期(取决于应用程序要求)
关于mysql - 如何在SQL中创建时间属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36354521/