Õâ¸öSQLÓï¾äÔõôд
ÓÐÒ»¸ö±í½á¹¹ÈçÏ£º
ÎïÆ·±àÂë ʹÓôÎÊý Ãû³Æ ÊôÐÔ1£¬ÊôÐÔ2.¡£¡£¡£¡£¡£¡£
ÆäÖУ¬Ç°Á½ÏîΪÖ÷¼ü£¨ÎïÆ·±àÂë ʹÓôÎÊý£©£¬´ÎÊý×î¶àΪ5
ÏÖÔÚÎÒÏë°Ñ ͬһÖÖÎïÆ·µÄ²»Í¬´ÎÊýµÄÊôÐÔ²é³öÀ´·ÅÔÚÒ»ÕűíÀï
Çë¸ßÊÖÖ¸µã£¡
û¿´¶®ÄãÏëʵÏÖʲô¡£
½¨ÒéÄãÁгöÄãµÄ±í½á¹¹£¬²¢Ìṩ²âÊÔÊý¾ÝÒÔ¼°»ùÓÚÕâЩ²âÊÔÊý¾ÝµÄËù¶ÔÓ¦ÕýÈ·½á¹û¡£
±ÈÈç˵ÓÐÏÂÁÐÊý¾Ý£º
ÎïÆ·±àÂë ʹÓôÎÊý Ãû³Æ ÊôÐÔ1£¬ÊôÐÔ2
001 1 aa 10 10
002 1 bb 10 10
003 1 cc 10 10
001 2 aa 20 20
002 2 bb 20 20
003 2 cc 20 20
ÏÖÔÚÎÒÏëµÃµ½µÄ½á¹û£º
µÚÒ»´Î µÚ¶þ´Î
ÎïÆ·±àÂë Ãû³Æ ÊôÐÔ1 ÊôÐÔ2 ÊôÐÔ1 ÊôÐÔ2
001 aa 10 10 20 20
002 bb 10 10 20 20
003 cc &nb
Ïà¹ØÎÊ´ð£º
±¾ÈËc#ÐÂÊÖ ¿ÉÊÇÒªÇóÒªÓÃc# £¬sql2000¿ª·¢c/sµÄ¹¤×÷Á÷£¬Ò»Í·ÎíË®£¬Çë´ó¼Ò°ïæ°ï棬¸øµã˼·£¬ËµµÄÔ¼¾ßÌåÔ½ºÃ£¬ÎÒÒ²ºÃÍùÄǸö·½Ãæȥѧϰ
http://www.hxzi.com/view/61402.html
B/S°æµÄ£¬»ù±¾Ë¼ÏëÓ¦¸Ã²î²»¶àµÄ¡£¡£ ......
sql server 2005 ´¥·¢Æ÷ Ö´ÐÐsp_executesql µÄÎÊÌâ
db1,db2ÊÇÒ»¸ö·þÎñÆ÷ server µÄ2¸öÊý¾Ý¿â
db1µÄtable1 ½¨Á¢Ò»¸öafter update´¥·¢Æ÷ ,µ± update table1 ºó½¨Á¢Ò»¸ö¸´ÖÆ±íµ½ db2µÄtabl ......
ÓÐÁ½Õűí T1, T2
T1:
id, name, T2id £¬discription
T2:
id, subName
ÆäÖÐ T1µÄ T2id ÓëT2µÄ id ¶ÔÓ¦
ÏëÒÔT1µÄ name ºÍ T2µÄ subName Ϊ Ìõ¼þ ²éÑ°T1µÄ discripton.
Çë¸ßÊÖÖ¸µ ......
ÏÈÀ´Ò»¸ö´íÎóÓï¾ä¡£¡£
select * from [aa] where a1 in (select max(a2),a1 from [aa] group by a1 )
ÎÒ´óÌåÒâ˼£¬
¶ÁÈ¡Ò»¸öͳ¼ÆϵͳÖÐ ²»Öظ´µÄ IP °´ÕÕ ×îºóʱ¼äÅÅÐò£¬²¢ÏÔʾ³öËùÓÐ×ֶΡ£¡ ......