摘要:
USE [TestDate]GO/****** 对象: Table [dbo].[region] 脚本日期: 11/02/2008 11:33:10 ******/SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGOSET ANSI_PADDING ONGOCREATE TABLE [dbo].[region]([region_id] [int] NULL,[region_name] [varchar](50) COLLATE Chinese_PRC_CI_AS NULL,[parend_id] [int] NULL,[sort_id] [int] NUL 阅读全文
摘要:
1.SELECT * FROM( SELECTROW_NUMBER() OVER (ORDER BY sort_key ASC) AS ROW_NUMBER,COLUMNSFROM tablename) fooWHERE ROW_NUMBER >= 11 and ROW_NUMBER <=202.selecttop10*fromOrderswhereOrderID>(selectmax(OrderID)from(selecttop20OrderIDfromOrdersorderbyOrderIDASC)t0)orderbyOrderIDASC3.select top 10t_ 阅读全文