gpt4 book ai didi

mysql - 从 mysql 中的表中选择最后 n 行而不使用 order by

转载 作者:行者123 更新时间:2023-11-29 15:18:19 26 4
gpt4 key购买 nike

select * from employee limit select count(*)-1 from employee,1;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(*)-1 from employee,1' at line 1

最佳答案

希望这个工作

select * from your_table except 
select top ((select count(*) from your_table) - how many rows you want)* from your_table

关于mysql - 从 mysql 中的表中选择最后 n 行而不使用 order by,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59535114/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com