SELECT TOP 10 *
FROM tablename
WHERE (id NOT IN
(SELECT TOP 10 id
FROM tablename))
这样子可以吗!其中id为表中的任何一个字段名称
FROM tablename
WHERE (id NOT IN
(SELECT TOP 10 id
FROM tablename))
这样子可以吗!其中id为表中的任何一个字段名称
解决方案 »
- WCF无法引用
- 做过gps卫星监控调度管理系统大侠进
- ===============================自定义控件的问题GridView+Button等等===================。
- 如何在不刷新页面,实现两个Dropdownlit控件联动的效果
- 我的分页控件为什么不能控制没页显示数据的条数啊 急! 望高手指点
- 在线急等,分不够再加!
- SQL语句行转列有人会么?
- VBSCRIPT脚本,能不能向网页写入字符??
- 如何取一个页所有控件的ID值啊!
- 如何让Web控件居中??
- 为什么我在未用IE浏览ASP.NET网页时,进入所在的目录,里面的文件是可写的(如.mdb文件)。当一浏览就变了是只读了,有什么方法改为可读
- 你知道他们之间的区别吗?
//然后筛选该列
DataSet ds = getdataset();
DataColumn dc = new DataColumn("testOrderID",typeof(long));
dc.AutoIncrement = true;
dc.AutoIncrementSeed =1;
dc.AutoIncrementStep = 1;
ds.Tables[0].Columns.Add(dc);
DataView dv = new DataView(dt,"testOrderID >10 and testOrderID <=20","testOrderID",System.Data.DataViewRowState.CurrentRows);
怎么会有记录被删就出错啦
查某条记录到某条记录之间,把上面形式改改就行了。
上面的前提是有一个递增的主键。
select * from TableName into #table where id not in (select top 10 id from tablename); select top 10 from #table
是高效掌握Asp.net这本书里的.wrox出的.
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_GetEmployeesByPage]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[sp_GetEmployeesByPage]
GOSET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GOCREATE PROCEDURE sp_GetEmployeesByPage
@PageNumber int,
@PageSize int
AS-- create a temporary table with the columns we are interested in
CREATE TABLE #TempEmployees
(
ID int IDENTITY PRIMARY KEY,
EmployeeID int,
LastName nvarchar(20),
FirstName nvarchar(10),
Title nvarchar(30),
TitleOfCourtesy nvarchar(25),
Address nvarchar(60),
City nvarchar(15),
Region nvarchar(15),
Country nvarchar(15),
Notes ntext
)-- fill the temp table with all the employees
INSERT INTO #TempEmployees
(
EmployeeID,
LastName,
FirstName,
Title,
TitleOfCourtesy,
Address,
City,
Region,
Country,
Notes
)
SELECT
EmployeeID,
LastName,
FirstName,
Title,
TitleOfCourtesy,
Address,
City,
Region,
Country,
Notes
FROM
Employees ORDER BY EmployeeID ASC-- declare two variables to calculate the range of records to extract for the specified page
DECLARE @FromID int
DECLARE @ToID int
-- calculate the first and last ID of the range of records we need
SET @FromID = ((@PageNumber - 1) * @PageSize) + 1
SET @ToID = @PageNumber * @PageSize-- select the page of records
SELECT * FROM #TempEmployees WHERE ID >= @FromID AND ID <= @ToID
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
newTable = new DataTable();
for (int i=0;i<myTable.Rows.Count;i++)
{
if (i>10)&&(i<19)
{
thisrow=new DataRow();
thisrow[0]=myTable.Rows[i][0] ;
thisrow[1]=myTable.Rows[i][1] ;
.....
newTable.Rows.Add()
}
}对不起,我大概写了一个,其中有些地方不对,你修改修改吧。