时间:2021-07-01 10:21:17 帮助过:6人阅读
create table student( id int, name char(6), born_year year, birth_date date, class_time time, reg_time datetime ); insert into student values (1,‘egon‘,now(),now(),now(),now()); insert into student values (2,‘alex‘,"1997","1997-12-12","12:12:12","2017-12-12 12:12:12");
CREATE TABLE `employees` ( `emp_no` int(11) NOT NULL, `birth_date` date NOT NULL, `first_name` varchar(14) NOT NULL, `last_name` varchar(16) NOT NULL, `gender` char(1) NOT NULL, `hire_date` date NOT NULL, PRIMARY KEY (`emp_no`));
select * from employees where hire_date = (select hire_date from employees order by hire_date desc limit 2,1 ); 注意limit 后面的 (n,m) n指索引 m是步长
sql练习题
标签:insert font student create ima datetime into 时间 倒数