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

ÇóÒ»¸ösql Óï¾ä

  table1
  Ãû³Æ      Èë¿âÊý
  CT»ú        3   
  CT»ú        5
  X¹â»ú      4
  X¹â»ú      5


ÒªÇó²éѯµÄ½á¹ûÈçÏ¡£»·¾³ÊÇsql server 2005

  Ãû³Æ      Èë¿âÊý
  CT»ú        3   
  CT»ú        5
  С¼Æ        8
  X¹â»ú      4
  X¹â»ú      5
  С¼Æ        9
SQL code:
select isnull(Ãû³Æ,'С¼Æ') as Ãû³Æ,sum(Èë¿âÊý) as Èë¿âÊý
from tb
group by Ãû³Æ with rollup


ÒýÓÃ
SQL codeselectisnull(Ãû³Æ,'С¼Æ')as Ãû³Æ,sum(Èë¿âÊý)as Èë¿âÊýfrom tbgroupby Ãû³Æwith rollup
up+²ä·Ö

ÄúÕâÊÇÔÚʲôÊý¾Ý¿â×ö°¡£¿

ÒýÓÃ
SQL codeselectisnull(Ãû³Æ,'С¼Æ')as Ãû³Æ,sum(Èë¿âÊý)as Èë¿âÊýfrom tbgroupby Ãû³Æwith rollup

SQL code:

DECLARE @TB TABLE([Ãû³Æ] NVARCHAR(3), [Èë¿âÊý] INT)
INSERT @TB
SELECT N'CT»ú', 3


Ïà¹ØÎÊ´ð£º

¹ØÓÚ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ÎÊÌâ

sql2005
select *from v_ddxx where d_sfsc='0' and (g_ssbm='1001' or g_ssbm='1002') and (xxf>0 and  xxfwzf <>0 ),Ö´ÐÐËÙ¶ÈÂýµÄÒªËÀ£¬µ«ÊÇÈç¹û°Ñ(xxf>0 and  ......

SQLÓï¾äÎÊÌ⣬¸ßÊÖ°ïæ£¡£¡

½«Ò»¸ö±í21~30ɾ³ý£¬sqlÓï¾äÔõôд
Õâ¸öÌ«ÁýͳÁË£¬ÊÇÅÅÐòºóµÄµÚ21Ìõµ½30Ìõ¼Ç¼ɾ³ý»¹ÊÇijһÁÐÖµÔÚ21µ½30Ö®¼äµÄɾ³ý°¡£¿

21-30ÊÇʲôÒâ˼£¿×ֶεϰ¾Ídelete from table1 where col1>=21 and col1<=30
Ö¸µ ......

sql ÎÊÌâ

DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)

string sql
sql = dw_1.GetSQLSelect()+"Where (StartTime> '"+startTime+"') and (EndTime ......

²ËÄñÌáÎÊ£¬Çó¼òµ¥sql ?



±íA

Sup_code    st_sup_code    buy_code      buy_code1 
1001        400            &nbs ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ