题目描述
有一个员工employees表简况如下:
建表语句如下:
1 2 3 4 5 6 7 8 |
|
请你查找employees里最晚入职员工的所有信息,以上例子输出如下:
答案:
select * from employees order by hire_date desc limit 1
select * from employees order by hire_date desc limit 0,1
select * from employees where hire_date=(select max(hire_date) from employees)
1.limit后面跟随排序后的查询条数,只跟一个数字n,默认从从0条后(第一条开始)向后数n条