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

sql Óï¾ä

±íA
¿¨ºÅ         ʱ¼ä
1                 null
2                 null
3                 null
±íB
¿¨ºÅ       ʱ¼ä
1             2008-1-6
1             2004-5-3
2             2005-5-6
3             2003-5-9
3             2001-2-3

ÎÊÌ⣺¸üР  ±íAÀïµÄ   ÏàÓ¦¿¨ºÅµÄʱ¼äΪ   ±íBÀïÏàÓ¦¿¨ºÅµÄ£¨×îС£©Ê±¼ä
ÕýÈ·µÄ½á¹û£º
1       2004-5-3£¨×îС£©
2       2005-5-6
3       2001-2-3£¨×îС£©
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.ʱ¼ä)


SQL code:
update t set ʱ¼ä=(select min(ʱ¼ä) from tb where ¿¨ºÅ=t.¿¨ºÅ) from ta t


SQL code



Code highlighting produced by


Ïà¹ØÎÊ´ð£º

access Êý¾Ý¿â SQLÓï¾äÔõôÑùËæ»úÑ¡ÔñÊý¾Ý£¿£¿

³ÌÐòʱASP+access

sql="select top 2 id,username from comp    order by rnd(id)  "

ÉÏÃæÓï¾äˢкó¶¼ÊÇÒ»¸öÖµ ÕâÑù»¹ÓÐËæ»úµÄÒâÒåÂð

ACCESSÓÐË¢ÐÂËæ»úÑ¡ÔñµÄSQLÓ ......

SQLÓï¾ä

BeginTime  BtsId Total68PhyRCENum
2009-9-30 0:00 1 192
2009-10-1 0:00 1 192
2009-10-2 0:00 1 192
2009-10-3 0:00 1 192
2009-10-4 0:00 1 256
2009-10-5 0:00 1 256
2009-10-6 0:0 ......

sql server 2008 sql serverÉí·ÝÑéÖ¤ÎÊÌâ

ÎÒϵͳʽwin7 £¬Êý¾Ý¿âsqlserver2008.Ò»Ö±ÓÃwindowsÑéÖ¤£¬µÇ½£¬²»ÄÜÓÃsqlÑéÖ¤£¬ÔÚsaÉÏÖØÐÂ×¢²áÒ»¸öÓû§µÄ»°£¬µÇ½ʱµÚÒ»±é±¨
Òѳɹ¦Óë·þÎñÆ÷½¨Á¢Á¬½Ó£¬µ«ÊÇÔڵǼ¹ý³ÌÖз¢Éú´íÈ¡¡££¨provider:¹²ÏíÄÚ´æÌṩ³ÌÐò£¬ ......

sql server browserºÍsql server sql server express

sql server browserºÍsql server sql server expressÊǸÉÂðµÄ
ÎÒÖ»ÊÇÓÃSQL2005×öÍøÕ¾Êý¾Ý¿â£¬ÇëÎÊ¿ÉÒÔ½ûÓÃÂð£¿
ÎÒÏë½ÚÔ¼·þÎñÆ÷×ÊÔ´
»¹ÓÐÒ»¸ösql server fill text search
Õâ¸öÓ¦¸ÃÊÇÈ«ÎÄËÑË÷°É£¬¿ÉÒÔÒ²¿ÉÒ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ