Home > Database > Mysql Tutorial > SqlServer中使用参数传递前N条条件

SqlServer中使用参数传递前N条条件

WBOY
Release: 2016-06-07 14:54:41
Original
1460 people have browsed it

declare @topN int ; select @topN=10; select top (@topN) * from TableName 一定要用() 否则无效 SQL 参数 declare @topN int; select @topN = 10; select top (@topN) * from TableName

  1. declare @topN int;   
  2. select @topN = 10;   
  3.   
  4. select top (@topN) * from TableName  

    一定要用() 否则无效

SQL 参数
declare @topN int;   
select @topN = 10;   
  
select top (@topN) * from TableName  
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template