SQLÎÊÌ⣿
[code=select a.fyear,b.fname,sum(a.fendbal) as fendbal,
'1ÔÂ'=case when fperiod=1 then sum(a.fendbal) else 0 end ,
'2ÔÂ'=case when fperiod=2 then sum(a.fendbal) else 0 end ,
'3ÔÂ'=case when fperiod=3 then sum(a.fendbal) else 0 end ,
'4ÔÂ'=case when fperiod=4 then sum(a.fendbal) else 0 end ,
'5ÔÂ'=case when fperiod=5 then sum(a.fendbal) else 0 end ,
'6ÔÂ'=case when fperiod=6 then sum(a.fendbal) else 0 end ,
'7ÔÂ'=case when fperiod=7 then sum(a.fendbal) else 0 end ,
'8ÔÂ'=case when fperiod=8 then sum(a.fendbal) else 0 end ,
'9ÔÂ'=case when fperiod=9 then sum(a.fendbal) else 0 end ,
'10ÔÂ'=case when fperiod=10 then sum(a.fendbal) else 0 end ,
'11ÔÂ'=case when fperiod=11 then sum(a.fendbal) else 0 end ,
'12ÔÂ'=case when fperiod=12 then sum(a.fendbal) else 0 end
from openrowset('sqloledb','192.168.12.101';'sa';'',ais20080707094757.dbo.icinvbal) as a
inner join openrowset('sqloledb','192.168.12.101';'sa';'',ais20080707094757.dbo.t_stock) as b
on a.fstockid=b.fitemid
group by a.fyear,a.fperiod,b.fname
with rollup
][/2008 ¸Ö²Ä¿â 3295826.03 .00 .00 .00 3295826.03 .00 .00 .00 .00 .00 .00 .00 .00
2008 NULL 3295826.03 .00 .00 .00 3295826.03 .00 .00 .00 .00 .00 .00 .00 .00
2008 °ë³ÉÆ·¿â 17935
Ïà¹ØÎÊ´ð£º
sql table±íÓиöÎı¾ÀàÐ͵Äa×ֶΣ¬´æ´¢µÄÄÚÈÝÈ«²¿ÊÇÊý×Ö£¬ÀýÈç2009001£¬2008578ÕâÑùµÄ¸ñʽ£»b×Ö¶ÎÎı¾ÀàÐÍ£¬´æµÄÒ²ÊÇÊý×ÖÀýÈç 001£¬123
aspÀïÃæ strday=100£¬strb=001
ÎÒÏë¶Á³ö£¬´Óa×ֶεÄÊý×Ö°´´óµ½Ð¡µÄË ......
with adod_dict do
begin
close;
commandtext:='select bgqxcode,count(*) wjsl from wscl_wsda_file where wjnd=:tnd group by bgqxcode'; ......
DateTime startTime=DateTime(em_1.Text)
DateTime endTime=DateTime(em_2.Text)
string sql
sql = dw_1.GetSQLSelect()+"Where (StartTime> '"+startTime+"') and (EndTime ......
create table jskb(
񅧏 int identity(1,1) primary key not null,
ÐÕÃû varchar(20) not null,
ÐÔ±ð char(1) not null ,
ÊÚ¿ÎÃû varchar(10) not null,
½ÌÊҺŠint(10)
)
´íÄÄÄØ£¿
cre ......