![](/img/trans.png)
[英]find first and last row of database table mysql in a single select without using UNION
[英]select last n row from a table in mysql without using order by
select * from employee limit select count(*)-1 from employee,1;
ERROR 1064 (42000):您的 SQL 语法有错误; 检查与您的 MySQL 服务器版本相对应的手册,了解在第 1 行的“select count(*)-1 from employee,1”附近使用的正确语法
希望这项工作
select * from your_table except
select top ((select count(*) from your_table) - how many rows you want)* from your_table
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.