您的位置:首页 > 数据库

1、根据存入条件操作不同sql语句。

2009-12-18 11:40 411 查看
ALTER PROCEDURE dbo.selectCustomerCNameCount
@customerID int
AS
if @customerID=-1
begin
select contentownerid ,userCName,count(*) as countAll from view_usercomment group
by contentownerid,userCName order by contentownerid DESC
end
else
begin
select contentownerid ,userCName,count(*) as countAll from view_usercomment where
contentownerid=@customerID group by contentownerid,userCName order by contentownerid
DESC
end

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: