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

Èç¹ûдµÝ¹ésqlÓï¾ä - MS-SQL Server / Ó¦ÓÃʵÀý

ÓÐÁ½¸öͬÑùµÄ±í½á¹¹ 
±í½á¹¹ÈçÏ£º
  id£¨ÐòºÅ£© parentid £¨¸¸½áµãÐòºÅ£© name(½áµãÃû³Æ)
 ±í1 ¼Ç¼ 1 0 aaa
  2 0 bbb
  3 1 ccc

  ¡£¡£¡£¡£¡£¡£
±í2 ¼Ç¼  
  1 0 bbb
  2 0 xxx

  ¡£¡£¡£¡£
±í1Óë±í2¶¼ÊÇÊ÷×´½á¹¹¼Ç¼¡£ÏÖÐèÒª½«±í1¼Ç¼µ¼Èëµ½±í2ÖÐ £¬±í2ÖÐÒѾ­Óв¿·Ö¼Ç¼£¬ÓÐЩ¼Ç¼Óë±í1ÖмǼÏàͬ¡£
ÏÖÐèÒª½«±í1ÖеļǼµ¼Èëµ½±í2ÖУ¬ÐèÒªÅжϱí2ÖÐûÓбí1¼Ç¼µÄÐèҪȫ²¿µ¼È룬²¢ÇÒÊ÷×´½á¹¹ºÍ±í1ÖеĽṹһÖ¡£

Óô洢¹ý³ÌÒ²¿ÉÒÔ¡£Ð»Ð»¡£


 
  
 
MRAK »ØÈ¥ÔÙ¿´

¶¥ÏÂ



SQL code:


insert into ±í2
select * from ±í1 a where not exists
(select 1 from ±í2 b where a.id=b.id and a.parentid=b.parentid and a.name=b.name)



ÒýÓÃ
SQL codeinsertinto ±í2select*from ±í1 awherenotexists
(select1from ±í2 bwhere a.id=b.idand a.parentid=b.parentidand a.name=b.name)

¿ÉÒÔ³¢ÊÔ

Ŷ ЧÂʰ¡Ð§ÂÊ

Ô­À´ÕâÑùÕæµÄ¿ÉÒÔ¡£¡£ÏëÁË¡£Ã»


Ïà¹ØÎÊ´ð£º

sqlÓï¾ä¶à±í¶à×ֶβéѯ - MS-SQL Server / »ù´¡Àà

ÎÒÓжà¸ö±íA B C ½á¹¹ÊÇÒ»ÑùµÄ£¬¶¼ÓÐ2¸ö×Ö¶ÎnameºÍcontent,ÎÒÒªËÑË÷ËùÒÔ±íËùÓÐ×Ö¶ÎÖаüº¬¡°Öйú¡±µÄÄÚÈÝ Õâ¸öSQLÓï¾äÔõôд 

ÈçºÎ½«¶à¸ö±íµÄ²éѯ½á¹ûÁ¬³ÉÒ»¸ö±í Õâ¸öSQLÓï¾äÔõôд ±íµÄ½á¹¹ÊÇÒ»ÑùµÄ
ÀýÈç£ ......

jspÁ´½Ósql2000µÄÒÉÎÊ£¿



type Exception report


message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jas ......

¾ÈÃü°¡£¡£¡JSPÁ¬½ÓSQL2000ÎÊÌ⣡

¸÷λ´óÏÀ¾ÈÃü°¡ £¡£¡
¸Õ×°ÁËSQL2000 sp3
ÏëÓÃJSPÁ¬½ÓÊý¾Ý¿âµ«ÊdzöÏÖÎÊÌâÁË
ÎÒÓõÄÊÇJDK6.0+tomcat5.0+SQL2000 SP3+JDBC sp3
ËüÏÔʾµÄÊÇ
javax.servlet.ServletException: [Microsoft][SQLServer 2000 Driver fo ......

SqlÅÅÐò - MS-SQL Server / »ù´¡Àà

ÎÒµÄTblworkbill±íµÄÊý¾ÝÈçÏÂ:
id workbillno ..................
1 1
2 6
3 a1
4 c2
5 2
6 aa
7 ......

ÇóÒ»¸öSQLÃüÁî

ÓÐÒ»Õűí(SHGL)
JLBH        LXR              LXDH            SHDZ
1            a ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ