Home > Database > Mysql Tutorial > body text

sqlserver,查询第N到M条记录,其中ID为唯一

WBOY
Release: 2016-06-07 17:43:47
Original
1287 people have browsed it

sqlserver,查询第N到M条记录,其中ID为唯一 1、SELECT TOP m-n+1 * FROM Score WHERE (id NOT IN (SELECT TOP n-1 id FROM Score)) 2、select top M-N * from yourTable where id not in(select top N-1 id from table) 3、select top M-N * from 表名 wher

sqlserver,网站空间,查询第N到M条记录,香港服务器租用,其中ID为唯一

1、SELECT TOP m-n+1 *
  FROM Score
  WHERE (id NOT IN
      (SELECT TOP n-1 id
       FROM Score))

 

2、select top M-N * from yourTable where id not in(select top N-1 id from table)

 

3、select top M-N * from 表名 where id in (select distinct(id) from 表名)

 

有时间记录下,香港空间,上面三种方法,只用了第一种就没再试了。

发表于

 

Related labels:
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!