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

SQL·ÖÒ³


SQL·ÖÒ³
ÍòÄÜ·ÖÒ³
.net´úÂë
select top Ã¿Ò³ÏÔʾµÄ¼Ç¼Êý * from topic where id not in     
 (select top £¨µ±Ç°µÄÒ³Êý-1£©×ÿҳÏÔʾµÄ¼Ç¼Êý id from topic order by id desc)      
 order by id desc    
select top ÿҳÏÔʾµÄ¼Ç¼Êý * from topic where id not in
(select top £¨µ±Ç°µÄÒ³Êý-1£©×ÿҳÏÔʾµÄ¼Ç¼Êý id from topic order by id desc)
order by id desc
sql2005·ÖÒ³
.net´úÂë
with temptbl as (      
  SELECT ROW_NUMBER() OVER (ORDER BY id desc)AS Row,       
  ...      
)      
SELECT * from temptbl where Row between @startIndex and @endIndex    

.net´úÂë
select top Ã¿Ò³ÏÔʾµÄ¼Ç¼Êý * from topic where id not in     
 (select top £¨µ±Ç°µÄÒ³Êý-1£©×ÿҳÏÔʾµÄ¼Ç¼Êý id from topic order by id desc)      
 order by id desc    
select top ÿҳÏÔʾµÄ¼Ç¼Êý * from topic where id not in
(select top £¨µ±Ç°µÄÒ³Êý-1£©×ÿҳÏÔʾµÄ¼Ç¼Êý id from topic order by id desc)
order by id desc
sql2005·ÖÒ³
.net´úÂë
with temptbl as (      
  SELECT ROW_NUMBER() OVER (ORDER BY id desc)AS Row,       
  ...      
)      
SELECT * from temptbl where Row between @startIndex and @endIndex    


Ïà¹ØÎĵµ£º

sql ʱ¼ä¸ñʽת»»

Óï¾ä¼°²éѯ½á¹û£º
SELECT CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
SELECT CONVERT(varchar(100), GETDATE(), 1): 05/16/06
SELECT CONVERT(varchar(100), GETDATE(), 2): 06.05.16
SELECT CONVERT(varchar(100), GETDATE(), 3): 16/05/06
SELECT CONVERT(varchar(100), GETDATE(), 4): 16.05.06
SE ......

°ÑSqlÊý¾Ýת»»ÎªÒµÎñÊý¾ÝµÄ¼¸ÖÖ·½·¨

ORMϵͳ±ØÐë°ÑÊý¾Ý¿âÖеÄÊý¾Ýת»»ÎªÒµÎñÊý¾Ý£¬×ª»»µÄ·½·¨´óÖÂÓÐ3ÖÖ£¬±¾ÎľÍÊÔͼ¶ÔËüÃÇ×öһЩ¼òµ¥·ÖÎö¡£
1¡¢ÊôÐÔ·´Éä¡£¾ÍÊÇͨ¹ý·´É䣬»ñȡҵÎñʵÌåÀàµÄ¸÷¸öÊôÐÔ£¬È»ºóÔÙÉèÖÃÕâЩÊôÐÔµÄÖµ¡£Õâ¸ö·½·¨×î¼òµ¥¡¢×îÎȶ¨¡¢Í¨ÓÃÐÔ×îÇ¿¡¢¿Éά»¤ÐÔ×îÇ¿¡¢ÐÔÄÜ×î²î¡£ÀýÈçNHibernate¾ÍÊÇÓÃÕâÖÖ·½·¨ÊµÏֵģ¬Ëüͨ¹ýIGetterºÍISetter½Ó¿ÚÊµÏ ......

SQL SERVER 2005 ÈçºÎÆô¶¯·þÎñ

1.¡¸¿ªÊ¼¡¹²Ëµ¥->ÔËÐÐ
--Æô¶¯sql server 2005 ·þÎñ
net start mssqlserver
--Í£Ö¹sql server 2005 ·þÎñ
net stop mssqlserver
2.¡¸¿ªÊ¼¡¹²Ëµ¥->³ÌÐò->Microsoft SQL Server 2005->ÅäÖù¤¾ß
SQL Server Configuration Manager->SQL Server(MSSQLSERVER) ÓÒ»÷ Æô¶¯·þÎñ³É¹¦ºó£¬×´Ì¬ÏÔʾΪ“ÕýÔÚÔËÐ ......

SQL SERVERÖн»ºÍ²îµÄʵÏÖ

create table aaa
(
id int primary key ,
name varchar(30) not null
)
create table bbb
(
id int primary key ,
name varchar(30) not null
)
--½»
select * from aaa
where exists
(
select * from bbb where aaa.id=bbb.id and aaa.name = bbb.name
)
--²î
select *
from bbb
where not exists
( ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ