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

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 serverÊý¾Ý¿â,Êý¾Ýµ¼Èëµ¼³öÎÊÌâ

ÏÖÔÚÓÐÁ½¸öÒì¹¹µÄsql serverÊý¾Ý¿â,ÎÒÏ뽫µÚÒ»¸ö±íÖеÄÊý¾Ýµ¼Èëµ½µÚ¶þ¸ö±íÖÐ,×Ô¼ºÖ¸¶¨µ¼ÈëÊý¾ÝµÄ×Ö¶Î,ÈçºÎµ¼ÈëÊý¾ÝÄØ,´ó¼ÒÌÖÂÛÒ»ÏÂ?
dts¹¤¾ß

µ¼Èëµ¼³ö¹¤¾ß.

DD

¹þ¹þ£¬¹À¼ÆÕâλÊǵØQIOU¶¼Êܲ»Á˵Ä

Ö±½ÓÐ ......

¹ØÓÚgroup byµÄsqlÓï¾ä£¿

  with adod_dict do
    begin
    close;
    commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......

SQL ÓÅ»¯ÇóÖú

Çë°ïæ¿´¿´ÔõôÓÅ»¯Ò»Ï£¬¸Ã±íÊý¾ÝԼΪ66Íò£¬ÔËÐÐʱ¼äÒª19Ãë,SQLÈçÏ£º

select DATEPART (hh ,Date_time ) as Hours ,
sum(Counts)*100.0/(Select sum(Counts) as total
      &nbs ......

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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ