--¶¨ÒåÈ«¾ÖÁÙʱ±í
declare @temp table(id int identity,¸¨ÖúÏÃÅ nvarchar(100),¿Í»§ nvarchar (100),
ÏîÄ¿Ãû³Æ nvarchar (100),¸¨ÖúÏîµÄÏúÊÛÒµÎñÀà±ð nvarchar (100),¿ÆÄ¿Ãû³Æ nvarchar (100),
½è·½½ð¶î float ,´û·½½ð¶î float)
--¶¨Òå¿ÆÄ¿±í
declare @tempTable table( ¿Æ ......
Êý¾Ý¿â
id subject shu liang Ò» ¶þ Èý
1 Ò» 100 200
2 ¶þ 333 111
3 Èý 44 55
Çó ......
xuehao '#9'VarChar(100) NOT NULL Default 0, --12 20'#23383#33410#9#24080#25143#22995#21517
ÄܰïÎÒ½âÊÍһϠÿ¸ö´Ê´ú±íµÄÒâ˼Â𣿠лл£¡
ºóÃæÄÇÒ»´®ÊÇʲô£¿
'#9' Õâ¸öÊÇ´íµÄ¡£
xuehaoÊǶ¨ÒåÒ»¸ö×Ö¶ÎÃû£¬VarChar(100)×Ö¶ÎÀàÐÍ£¬NOT NULL·Ç¿ÕÔ¼Êø£¬Default 0 ¶¨ÒåÄ ......
ÏÖÔÚÓÐ2¸ö±í
Group±í
SQL code:
GroupID GroupName
1 A×é
2 B×é
UserGroup±í
SQL code:
ID UserID GroupID
1 3 1
2 4 1
ÏÖÔÚÎÒÏëÈ¡³öÕâÑùµÄÊý¾Ý
GroupID GroupName Group±íÖеÄÓ ......
SQL code:
declare @t1 table(ÊýÖµ decimal(10,2))
insert into @t1 values(200)
insert into @t1 values(150)
insert into @t1 values(199)
insert into @t1 values(200)
select sum(ÊýÖµ)as a ,a*2 as b from @t1
ÏëÒªµÄ½á¹û
===========================================
a b
749.00 14 ......
A±í£¨Ö÷±í£©
A1£¨Ö÷¼ü£© A2
1 ÕÅÈý
B±í
B1£¨Íâ¼ü£© B2
1 ZHONG
1 GUO
C±í
C1£¨Íâ¼ü£© C ......