求助高手!
16 个解决方案
#1
用rowid
#2
select top 10 * from A where ID not in (select top 30 ID from A)
#3
SELECT TOP 10 * FROM 表WHERE 主键ID NOT IN (SELECT TOP 30 主键ID FROM 表)
#4
你在怀疑楼主的智商吗。。
#5
SELECT TOP 10 * FROM 表 WHERE 主键ID NOT IN (SELECT TOP 30 主键ID FROM 表 ORDER BY 主键ID)
ORDER BY 主键ID
#6
很多公司面试的时候都会出这道题目啊。
lz你有点out了~
lz你有点out了~
#7
小虎很快
#8
解1: select top 10 * from A where id not in (select top 30 id from A)
解2: select top 10 * from A where id > (select max(id) from (select top 30 id from A )as A)
解2: select top 10 * from A where id > (select max(id) from (select top 30 id from A )as A)
#9
jfjf
#10
小虎,UP!
#11
1. SELECT TOP 10 * FROM (SELECT TOP 40 * FROM A ORDER by ID ) t ORDER BY ID desc
//先取出表数据40条,最后查询按倒序限制10条数据,取出31-40条记录.
2. select top 10 * from A where id > (select max(id) from (select top 30 id from A )as A)
#12
select top m * from tablename where id not in (select top n * from tablename)
SELECT TOP 10 *
FROM (SELECT TOP 40 *
FROM tb
ORDER by id) t
ORDER BY id desc
select top 10 * from (select top 40 * from table) t order by id desc
SELECT TOP 10 *
FROM (SELECT TOP 40 *
FROM tb
ORDER by id) t
ORDER BY id desc
select top 10 * from (select top 40 * from table) t order by id desc
#13
from a in ADB.Skip(30).Take(10) select a;
#14
不管是SQL还是Linq都被你们写完了,我还怎么回啊
#15
哎 jf
#16
select top 10 * from test where id not in(select top 30 id from test order by id) order by id
#1
用rowid
#2
select top 10 * from A where ID not in (select top 30 ID from A)
#3
SELECT TOP 10 * FROM 表WHERE 主键ID NOT IN (SELECT TOP 30 主键ID FROM 表)
#4
你在怀疑楼主的智商吗。。
#5
SELECT TOP 10 * FROM 表 WHERE 主键ID NOT IN (SELECT TOP 30 主键ID FROM 表 ORDER BY 主键ID)
ORDER BY 主键ID
#6
很多公司面试的时候都会出这道题目啊。
lz你有点out了~
lz你有点out了~
#7
小虎很快
#8
解1: select top 10 * from A where id not in (select top 30 id from A)
解2: select top 10 * from A where id > (select max(id) from (select top 30 id from A )as A)
解2: select top 10 * from A where id > (select max(id) from (select top 30 id from A )as A)
#9
jfjf
#10
小虎,UP!
#11
1. SELECT TOP 10 * FROM (SELECT TOP 40 * FROM A ORDER by ID ) t ORDER BY ID desc
//先取出表数据40条,最后查询按倒序限制10条数据,取出31-40条记录.
2. select top 10 * from A where id > (select max(id) from (select top 30 id from A )as A)
#12
select top m * from tablename where id not in (select top n * from tablename)
SELECT TOP 10 *
FROM (SELECT TOP 40 *
FROM tb
ORDER by id) t
ORDER BY id desc
select top 10 * from (select top 40 * from table) t order by id desc
SELECT TOP 10 *
FROM (SELECT TOP 40 *
FROM tb
ORDER by id) t
ORDER BY id desc
select top 10 * from (select top 40 * from table) t order by id desc
#13
from a in ADB.Skip(30).Take(10) select a;
#14
不管是SQL还是Linq都被你们写完了,我还怎么回啊
#15
哎 jf
#16
select top 10 * from test where id not in(select top 30 id from test order by id) order by id