djcsch2001

create table testTop

(
 value int primary key
)

--可以一次插入顶部的多条记录

insert top(5) into testTop 
select *
from (select 1 as value union select 2 union select 3 union select 4
   union select 5 union select 6 union select 7) as sevenRows
go 

 

select * from testTop

update top(2) testTop

set value=value * 100 delete top(3) testTop

 

--可以动态设定top的参数

declare @rowsToReturn int
select  @rowsToReturn=10
select Top(@rowsToReturn) *
from HumanResources.Employee

分类:

技术点:

相关文章:

  • 2021-12-14
  • 2021-09-08
  • 2021-08-29
  • 2021-11-15
  • 2021-12-14
  • 2021-08-04
  • 2021-09-01
猜你喜欢
  • 2021-08-02
  • 2021-08-02
  • 2021-10-15
  • 2021-08-02
  • 2021-08-02
  • 2017-12-20
  • 2019-07-19
相关资源
相似解决方案