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

×ܽᾭµä³£ÓõÄSQLÓï¾ä£¨1£©

˵Ã÷£º¸´ÖƱí(Ö»¸´Öƽṹ,Ô´±íÃû£ºa бíÃû£ºb)¡¡¡¡
¡¡¡¡SQL: select * into b from a where 1<>1
¡¡¡¡ËµÃ÷£º¿½±´±í(¿½±´Êý¾Ý,Ô´±íÃû£ºa Ä¿±ê±íÃû£ºb)¡¡¡¡
¡¡¡¡SQL: insert into b(a, b, c) select d,e,f from b;
¡¡¡¡ËµÃ÷£ºÏÔʾÎÄÕ¡¢Ìá½»È˺Í×îºó»Ø¸´Ê±¼ä¡¡¡¡
¡¡¡¡SQL: select a.title,a.username,b.adddate from table a,(select max(adddate) adddate from table where table.title=a.title) b
¡¡¡¡ËµÃ÷£ºÍâÁ¬½Ó²éѯ(±íÃû1£ºa ±íÃû2£ºb)¡¡¡¡
¡¡¡¡SQL: select a.a, a.b, a.c, b.c, b.d, b.f from a LEFT OUT JOIN b ON a.a = b.c
¡¡¡¡ËµÃ÷£ºÈճ̰²ÅÅÌáÇ°Îå·ÖÖÓÌáÐÑ¡¡¡¡
¡¡¡¡SQL: select * from Èճ̰²ÅÅ where datediff(’minute’,f¿ªÊ¼Ê±¼ä,getdate())>5¡¡¡¡
¡¡¡¡ËµÃ÷£ºÁ½ÕŹØÁª±í£¬É¾³ýÖ÷±íÖÐÒѾ­ÔÚ¸±±íÖÐûÓеÄÐÅÏ¢
¡¡¡¡SQL: ¡¡¡¡
¡¡¡¡delete from info where not exists ( select * from infobz where info.infid=infobz.infid
¡¡¡¡ËµÃ÷£º--
¡¡¡¡SQL: ¡¡¡¡
¡¡¡¡SELECT A.NUM, A.NAME, B.UPD_DATE, B.PREV_UPD_DATE
¡¡¡¡ from TABLE1,
¡¡¡¡ (SELECT X.NUM, X.UPD_DATE, Y.UPD_DATE PREV_UPD_DATE
¡¡¡¡ from (SELECT NUM, UPD_DATE, INBOUND_QTY, STOCK_ONHAND
¡¡¡¡ from TABLE2
¡¡¡¡ WHERE TO_CHAR(UPD_DATE,’YYYY/MM’) = TO_CHAR(SYSDATE, ’YYYY/MM’)) X,
(SELECT NUM, UPD_DATE, STOCK_ONHAND
¡¡¡¡ from TABLE2
¡¡¡¡ WHERE TO_CHAR(UPD_DATE,’YYYY/MM’) =
¡¡¡¡ TO_CHAR(TO_DATE(TO_CHAR(SYSDATE, ’YYYY/MM’) ¦¦ ’/01’,’YYYY/MM/DD’) - 1, ’YYYY/MM’) Y,
¡¡¡¡ WHERE X.NUM = Y.NUM £¨+£©
¡¡¡¡ AND X.INBOUND_QTY + NVL(Y.STOCK_ONHAND,0) <> X.STOCK_ONHAND B
¡¡¡¡WHERE A.NUM = B.NUM
¡¡¡¡ËµÃ÷£º--
¡¡¡¡SQL: ¡¡¡¡
¡¡¡¡select * from studentinfo where not exists(select * from student where studentinfo.id=student.id) and ϵÃû³Æ=’"&strdepartmentname&"’ and רҵÃû³Æ=’"&strprofessionname&"’ order by ÐÔ±ð,ÉúÔ´µØ,¸ß¿¼×ܳɼ¨
¡¡¡¡ËµÃ÷£º
´ÓÊý¾Ý¿âÖÐÈ¥Ò»ÄêµÄ¸÷µ¥Î»µç»°·Ñͳ¼Æ(µç»°·Ñ¶¨¶îºØµç»¯·ÊÇåµ¥Á½¸ö±íÀ´Ô´£©
¡¡¡¡SQL: ¡¡
¡¡¡¡SELECT a.userper


Ïà¹ØÎĵµ£º

SQL Server Á¬½Ó×Ö·û´®ºÍÉí·ÝÑéÖ¤

SQL Server .NET Data Provider Á¬½Ó×Ö·û´®°üº¬Ò»¸öÓÉһЩÊôÐÔÃû/Öµ¶Ô×é³ÉµÄ¼¯ºÏ¡£Ã¿Ò»¸öÊôÐÔ/Öµ¶Ô¶¼ÓɷֺŸô¿ª¡£
         PropertyName1=Value1;PropertyName2=Value2;PropertyName3=Value3;.....
ͬÑù£¬Á¬½Ó×Ö·û´®±ØÐë°üº¬SQL ServerʵÀýÃû³Æ:
     ......

SQL Server ±ÊÊÔÌâ

Ò» µ¥´Ê½âÊÍ(2·Ö/¸ö) 34·Ö
¡¡¡¡Data Êý¾Ý Database Êý¾Ý¿â RDBMS ¹ØϵÊý¾Ý¿â¹ÜÀíϵͳ GRANT ÊÚȨ
¡¡¡¡REVOKE È¡ÏûȨÏÞ DENY ¾Ü¾øȨÏÞ DECLARE ¶¨Òå±äÁ¿ PROCEDURE´æ´¢¹ý³Ì
¡¡¡¡ÊÂÎñ Transaction ´¥·¢Æ÷ TRIGGER ¼ÌÐø  continue Ψһ unqiue
¡¡¡¡Ö÷¼ü primary key  ±êʶÁÐ identity Íâ¼ü foreign key  ¼ì ......

SQL¡¡Êý¾Ý¿âÉú³É×Ô¶¯±àºÅ´úÂë

--exec  [P_AutoGenerateNumber]  'reception_apply','generate_code','',7
/*
 ¹ý³Ì˵Ã÷:Éú³É×Ô¶¯±àºÅ 
 ´´½¨Ê±¼ä:2010Äê1ÔÂ12ÈÕ
 ×÷Õß:feng
 debug:ÉÐδ¿¼ÂDZàºÅÒç³öÇé¿ö
*/ 
ALTER proc [P_AutoGenerateNumber]
  (
  @table ......

Top 10 Features of SQL 2008 R2

Introduction
Microsoft SQL Server 2008 R2 is the latest release of SQL Server. This article will introduce the top 10 features and benefits of SQL Server 2008 R2. The “R2” tag indicates this is an intermediate release of SQL Server and not a major revision. However, there are a number o ......

SQL ServerÊý¾Ý¿â±¸·ÝºÍ»Ö¸´´ëÊ©

Ò»¡¢±¸·ÝÊý¾Ý¿â
1¡¢´ò¿ªSQLÆóÒµ¹ÜÀíÆ÷£¬ÔÚ¿ØÖÆ̨¸ùĿ¼ÖÐÒÀ´Îµã¿ªMicrosoft SQL Server
2¡¢SQL Server×é-->Ë«»÷´ò¿ªÄãµÄ·þÎñÆ÷-->Ë«»÷´ò¿ªÊý¾Ý¿âĿ¼
3¡¢Ñ¡ÔñÄãµÄÊý¾Ý¿âÃû³Æ£¨ÈçÂÛ̳Êý¾Ý¿âForum£©-->È»ºóµãÉÏÃæ²Ëµ¥ÖеŤ¾ß-->Ñ¡Ôñ±¸·ÝÊý¾Ý¿â
4¡¢±¸·ÝÑ¡ÏîÑ¡ÔñÍêÈ«±¸·Ý£¬Ä¿µÄÖеı¸·Ýµ½Èç¹ûÔ­À´Óз¾¶ºÍÃû³ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ