SELECT last_name
FROM employees
order by last_name DESC
fetch first 5 rows only;
我是SQL的初学者。我正在尝试运行此查询但仍然收到错误
sql命令未正确结束
我做错了什么?
答案 0 :(得分:1)
select * from
(select last_name, row_number() over(order by last_name desc nulls last) rnm
from employees)
where rnm<=5;
SELECT last_name
FROM employees
ORDER BY last_name DESC
OFFSET 1 ROWS FETCH NEXT 5 ROWS ONLY;