sql ±¯¾ç
http://topic.csdn.net/u/20091008/12/a2577eba-1b5b-4e1e-ab20-0a047bf3f8d7.html?4385
1Â¥
liangCK
SQL code:
update a set
ʱ¼ä = b.ʱ¼ä
from tb1 as a
join tb2 as b
on a.¿¨ºÅ= b.¿¨ºÅ
where not exists(select * from tb2
where ¿¨ºÅ=b.¿¨ºÅ and ʱ¼ä> b.ʱ¼ä)
3Â¥
liangCK
SQL code:
update a set
ʱ¼ä = b.ʱ¼ä
from @tb1 as a
join @tb2 as b
on a.¿¨ºÅ= b.¿¨ºÅ
where not exists(select * from @tb2
where ¿¨ºÅ=b.¿¨ºÅ and ʱ¼ä< b.ʱ¼ä)
µ±Ê±ÎÒûÓп´µ½3Â¥µÄÕý½â£¬ÓÚÊǾͷ¢ÁËÒ»¸öÌû×Ó
http://topic.csdn.net/u/20091008/13/490b3e82-3e4c-4e7d-a5a1-a2632e355bd8.html?32712
¿´À´ wufeng4552 xuejie09242 navy887
¶¼Ã»Óп´µ½ Ìû×ÓÖеĴíÎó°¡
b ÄÚ±í
1 2007 1 2007
1 2008 1 2008
1 2004 1 2004
2007 = <all N
2008 = <all n
2004 = <all n
Ó¦¸ÃÊǰѱÈ×îСµÄ¶¼Åųýµô
±ÈÈç
2007>(2007 2008 2004) y
2008>(2007 2008 2004)
Ïà¹ØÎÊ´ð£º
sql table±íÓиöÎı¾ÀàÐ͵Äa×ֶΣ¬´æ´¢µÄÄÚÈÝÈ«²¿ÊÇÊý×Ö£¬ÀýÈç2009001£¬2008578ÕâÑùµÄ¸ñʽ£»b×Ö¶ÎÎı¾ÀàÐÍ£¬´æµÄÒ²ÊÇÊý×ÖÀýÈç 001£¬123
aspÀïÃæ strday=100£¬strb=001
ÎÒÏë¶Á³ö£¬´Óa×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......
ÏÖÔÚÓÐÁ½¸öÒì¹¹µÄsql serverÊý¾Ý¿â,ÎÒÏ뽫µÚÒ»¸ö±íÖеÄÊý¾Ýµ¼Èëµ½µÚ¶þ¸ö±íÖÐ,×Ô¼ºÖ¸¶¨µ¼ÈëÊý¾ÝµÄ×Ö¶Î,ÈçºÎµ¼ÈëÊý¾ÝÄØ,´ó¼ÒÌÖÂÛÒ»ÏÂ?
dts¹¤¾ß
µ¼Èëµ¼³ö¹¤¾ß.
DD
¹þ¹þ£¬¹À¼ÆÕâλÊǵØQIOU¶¼Êܲ»Á˵Ä
Ö±½ÓÐ ......
±íA
¿¨ºÅ ʱ¼ä
1 null
2 null
3 & ......