求列的第一个值

来源:互联网 发布:c语言宏定义 编辑:程序博客网 时间:2024/06/01 08:41

求第一个值

select * from (select * from table order by key) where rownum=1;


求最后一个值

select * from (select * from table order by key desc) where rownum=1;


sqlserver

select top 1 xx from xxx;



mysql

select * from xxx limit 1