首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

触发器统计表总量解决方法

2012-01-21 
触发器统计表总量sql2 selectd.property_value,d.valueid,sql2sql2& (selectcount(0)sql2sql2& fr

触发器统计表总量
sql2= "select   d.property_value,d.valueid,   "
sql2=sql2& "   (select   count(0)   "
sql2=sql2& "   from   [Cate_Property_value]   a   inner   join   vProduct   b   "
sql2=sql2& "   on   dbo.compare(b.属性,a.valueid)=1   "
sql2=sql2&   "   where   a.propertyid= "&rs1( "propertyid ")& "   and   a.valueid=d.valueid   and   1=1 "
If   keyword <> " "   Then   sql2=sql2& "   and   b.物品名称   like   '% "&keyword& "% ' "
If   aid <> " "   Then   sql2=sql2& "   and   substring(b.物品类别,1,len( ' "&aid& " '))= ' "&aid& " ' "
sql2=sql2& ")   as   total   from   [Cate_Property_value]   d "
sql2=sql2& "   where   d.propertyid= "&rs1( "propertyid ")& "   "

像这样一条语句,我想用触发器来实现符合记录的统计,触发器该怎么写?谁能帮我写个简单的例子吗?

[解决办法]
?
[解决办法]
在说什么
晕了

热点排行
Bad Request.