asp网页中sql查询

来源:百度知道 编辑:UC知道 时间:2024/05/10 07:10:06
以下是查询 前6条,而我想要7-12条 怎么写?
请写详细!

sql="select top 6 F_BoardID,F_AnnounceID,F_ViewNum, F_Filename ,F_Readme,F_id from [dv_upfile] where F_Type=1 and F_FileType='jpg' and F_BoardID not in (5) And F_AnnounceID in(select DISTINCT F_AnnounceID from [dv_upfile] where F_Type=1 and F_FileType='jpg' and F_BoardID not in (5)) order by F_id desc"

sql="select top 6 * from [dv_upfile] where F_BoardID in
//注释:加入这么一句,用where ...in
(where select top 6 F_BoardID,F_AnnounceID,F_ViewNum, F_Filename ,F_Readme,F_id from [dv_upfile] where F_Type=1 and F_FileType='jpg' and F_BoardID not in (5) And F_AnnounceID in(select DISTINCT F_AnnounceID from [dv_upfile] where F_Type=1 and F_FileType='jpg' and F_BoardID not in (5)) order by F_id desc")

select top 6 from (select top 12 F_BoardID,F_AnnounceID,F_ViewNum, F_Filename ,F_Readme,F_id from [dv_upfile] where F_Type=1 and F_FileType='jpg' and F_BoardID not in (5) And F_AnnounceID in(select DISTINCT F_AnnounceID from [dv_upfile] where F_Type=1 and F_FileType='jpg' and F_BoardID not in (5)) order by F_id desc) order by F_id asc