关于SQL语名问题啊

来源:百度知道 编辑:UC知道 时间:2024/05/31 07:00:43
我想选择第一条满足条件的记录的SQL语名怎么写啊?

SQL Server的语法是 select top 1 * from ....
Mysql 的语法是 select * from ... limit 0,1
Oracle的语法是 select b.* from (select a.*,rownum rn from ..) b where b.rn<=1

select top 1 * from [表名] where 条件

在条件中写上where rownum=1
就是第一行的意思