Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

SQL Server 2005 ÖеÄRow_Number()º¯Êý

±¾ÎÄÀ´×Ô£ºhttp://www.cnblogs.com/digjim/archive/2006/09/20/509344.html
 ÎÒÃÇÖªµÀ£¬SQL Server 2005ºÍSQL Server 2000 Ïà±È½Ï£¬SQL Server 2005ÓкܶàÐÂÌØÐÔ¡£ÕâƪÎÄÕÂÎÒÃÇÒªÌÖÂÛÆäÖеÄÒ»¸öк¯ÊýRow_Number()¡£Êý¾Ý¿â¹ÜÀíÔ±ºÍ¿ª·¢ÕßÒѾ­ÆÚ´ýÕâ¸öº¯ÊýºÜ¾ÃÁË£¬ÏÖÔÚÖÕÓڵȵ½ÁË£¡
 Í¨³££¬¿ª·¢Õߺ͹ÜÀíÔ±ÔÚÒ»¸ö²éѯÀÓÃÁÙʱ±íºÍÁÐÏà¹ØµÄ×Ó²éѯÀ´¼ÆËã²úÉúÐкš£ÏÖÔÚSQL Server 2005ÌṩÁËÒ»¸öº¯Êý£¬´úÌæËùÓжàÓàµÄ´úÂëÀ´²úÉúÐкš£
 ÎÒÃǼÙÉèÓÐÒ»¸ö×ÊÁÏ¿â[EMPLOYEETEST]£¬×ÊÁÏ¿âÖÐÓÐÒ»¸ö±í[EMPLOYEE]£¬Äã¿ÉÒÔÓÃÏÂÃæµÄ½Å±¾À´²úÉú×ÊÁϿ⣬±íºÍ¶ÔÓ¦µÄÊý¾Ý¡£
 USE [MASTER]
GO
IF  EXISTS (SELECT NAME from SYS.DATABASES WHERE NAME = N'EMPLOYEE TEST')
DROP DATABASE [EMPLOYEE TEST]
GO
CREATE DATABASE [EMPLOYEE TEST]
GO
USE [EMPLOYEE TEST]
GO
IF  EXISTS SELECT * from SYS.OBJECTS HERE OBJECT_ID = OBJECT_ID(N'[DBO].[EMPLOYEE]') AND TYPE IN (N'U'))
DROP TABLE [DBO].[EMPLOYEE]
GO
CREATE TABLE EMPLOYEE (EMPID INT, FNAME VARCHAR(50),LNAME VARCHAR(50))
GO
INSERT INTO EMPLOYEE  (EMPID, FNAME, LNAME) VALUES (2021110, 'MICHAEL', 'POLAND')
INSERT INTO EMPLOYEE  (EMPID, FNAME, LNAME) VALUES (2021110, 'MICHAEL', 'POLAND')
INSERT INTO EMPLOYEE  (EMPID, FNAME, LNAME) VALUES (2021115, 'JIM', 'KENNEDY')
INSERT INTO EMPLOYEE  (EMPID, FNAME, LNAME) VALUES (2121000, 'JAMES', 'SMITH')
INSERT INTO EMPLOYEE  (EMPID, FNAME, LNAME) VALUES (2011111, 'ADAM', 'ACKERMAN')
INSERT INTO EMPLOYEE  (EMPID, FNAME, LNAME) VALUES (3015670, 'MARTHA', 'LEDERER')
INSERT INTO EMPLOYEE  (EMPID, FNAME, LNAME) VALUES (1021710, 'MARIAH', 'MANDEZ')
GO
 ÎÒÃÇ¿ÉÒÔÓÃÏÂÃæµÄ½Å±¾²éѯEMPLOYEE±í¡£
 SELECT EMPID, RNAME, LNAME from EMPLOYEE
 Õâ¸ö²éѯµÄ½á¹ûÓ¦¸ÃÈçͼ1.0 
2021110
MICHAEL
POLAND
2021110
MICHAEL
POLAND
2021115
JIM
KENNEDY
2121000
JAMES
SMITH
2011111
ADAM
ACKERMAN
3015670
MARTHA
LEDERER
1021710
MARIAH
MANDEZ
ͼ1.0
 ÔÚSQL Server 2005£¬Òª¸ù¾ÝÕâ¸ö±íÖеÄÊý¾Ý²úÉúÐкţ¬ÎÒͨ³£Ê¹ÓÃÏÂÃæµÄ²éѯ¡£ 
SELECT ROWID=IDENTITY(int,1,1) , EM


Ïà¹ØÎĵµ£º

Sql Server 2005Êý¾Ý¿â±»±ê¼ÇΪ¡°¿ÉÒÉ¡±ÎÊÌâ


ÎÊÌâ±³¾°£º
¡¡¡¡ÈÕ³£¶ÔSql Server 2005¹ØϵÊý¾Ý¿â½øÐвÙ×÷ʱ£¬ÓÐʱ¶ÔÊý¾Ý¿â£¨È磺SharepointÍøÕ¾ÅäÖÃÊý¾Ý¿âÃû
Sharepoint_Config£©½øÐÐЩ²»Õý³£²Ù×÷ÈçÊý¾Ý¿âÔÚ¶Áдʱ¶øÎÞ¹ÊÍ£Ö¹Êý¾Ý¿â£¬´Ó¶øµ¼ÖÂSql Server 2005Êý¾Ý¿â²»Õý³£
Öжϣ¬µ±Ôٴδò¿ªÊý¾Ý¿âʱ»á·¢ÏÖijЩÊý¾Ý¿â»á±»±ê¼ÇΪ“¿ÉÒÉ”£¨suspect)£¬¼´ÔÚÊý¾ ......

Java·ÀÖ¹SQL×¢Èë

 SQL×¢ÈëÊÇ×î³£¼ûµÄ¹¥»÷·½Ê½Ö®Ò»,Ëü²»ÊÇÀûÓòÙ×÷ϵͳ»òÆäËüϵͳµÄ©¶´À´ÊµÏÖ¹¥»÷µÄ,¶øÊdzÌÐòÔ±ÒòΪûÓÐ×öºÃÅжÏ,±»²»·¨
Óû§×êÁËSQLµÄ¿Õ×Ó,ÏÂÃæÎÒÃÇÏÈÀ´¿´ÏÂʲôÊÇSQL×¢Èë:
          ±ÈÈçÔÚÒ»¸öµÇ½½çÃæ,ÒªÇóÓû§ÊäÈëÓû§ÃûºÍÃÜÂë:
     & ......

¡¾×ܽ᡿oracle»Ö¸´Îóɾ³ýÊý¾Ý£¬½â³ýËø¶¨µÄµÈsqlÓï¾ä

1.Ôø¾­²»Ð¡ÐÄ°Ñ¿ª·¢¿âµÄÊý¾Ý¿â±íÈ«²¿É¾³ý£¬µ±Ê±ÏŵÄÒªËÀ¡£½á¹ûÕÒµ½ÏÂÃæµÄÓï¾ä»Ö¸´µ½ÁË1¸öСʱ֮ǰµÄÊý¾Ý£¡ºÜ¼òµ¥¡£
×¢ÒâʹÓùÜÀíÔ±µÇ¼ϵͳ£º
select * from ±íÃû as of timestamp sysdate-1/12 //²éѯÁ½¸öСʱǰµÄij±íÊý¾Ý£¡¼ÈÈ»Á½Ð¡Ê±ÒÔÇ°µÄÊý¾Ý¶¼µÃµ½ÁË£¬¼ÌÐøÔõô×ö£¬ÖªµÀÁË°É¡£¡£

Èç¹ûdropÁË±í£¬Ôõô°ì£¿£¿¼ûÏ ......

SQL ServerÁ¬½ÓÔ¶³ÌÊý¾ÝÔ´

SQL ServerÁ¬½ÓÔ¶³ÌÊý¾ÝÔ´µÄ»ù±¾·½·¨ÓÐÏÂÃæÈýÖÖ£º
OPENDATASOURCE
: The OPENDATASOURCE function is used to
specify connection information for a remote data source by specifying
the OLE DB provider and an initialization string. OPENDATASOURCE can be
used directly within a SELECT, INSERT, UPDATE, or ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ