程序博客网 > 淘宝h5页面制作
来源:互联网 发布:淘宝h5页面制作 编辑:程序博客网 时间:2024/04/29 06:54
CREATE PROCEDURE Webn_Product_GetListSingleMember@hcid int,@shownum int,@scid intASdeclare @sql nvarchar(1000)if @scid=0 set @sql='select top '+str(@shownum)+' * from products t where productid=(select max(productid) from products where memberid=t.memberid) and hcid='+str(@hcid)+' order by productid desc'elseset @sql='select top '+str(@shownum)+' * from products t where productid=(select max(productid) from products where memberid=t.memberid) and hcid='+str(@hcid)+' and scid='+str(@scid)+' order by productid desc'--print(@sql)exec(@sql)GO