你用的时候
usp_account('(1,2,3)')可以吗?
usp_account('(1,2,3)')可以吗?
解决方案 »
- QuickReport 能不能实现取消分页的功能阿?
- 关于delphi接口中olevariant的调用
- Dbgrid中如何实现加一类似CheckBox的列来做多选?
- delphi如何实现 【新浪微博 登陆 和 关注他人】
- 我好害怕, 听说DELPHI的EXE很容易被反编译过来,高手给解答一下吧:(
- 我究竟错那了?新手请教!
- [長篇] 我的回憶和有趣的故事 - C/C++ 聖戰篇
- 高难度问题:如何在电子阅读程序中应用样式表?
- 用Delphi 5 调用 VC++ 6 的dll类中的函数出现问题(Access Violation)
- 初学者请教delphi的语法
- 请教高手:如何用Mouse Hook屏幕取词,要能在Win2000下运行的。
- 三层架构中Client与ApplicationServer互相通讯的问题,特别邀请:chechy(我爱洁洁)
create function usp_account(@for_code varchar(200))
returns table
as
return(Select b.material_code,sum(b.qty) as qty
from master a, detail b where a.for_cod=b.for_code
and A.for_code in (@For_code))
create function usp_account(@for_code varchar(200))
returns table
as
return(Select b.material_code,sum(b.qty) as qty
from master a, detail b where a.for_cod=b.for_code
and A.for_code in (@For_code))
Select b.material_code,sum(b.qty) as qty
from master a, detail b where a.for_cod=b.for_code
and A.for_code in (SELECT FIELDNAME FROM TABLE WHERE
FIELDNAME=@For_code)
如果不能从数据库中取,就多用几个参数。
Create procedre usp_account @for_code varchar(200)
as
begin
Select b.material_code,sum(b.qty) as qty
from master a, detail b where a.for_cod=b.for_code
and A.for_code in (@For_code)
Group By b.material
end
Create procedre usp_account @for_code varchar(200)
as
begin
declare @str varchar(500)
select @str='Select b.material_code,sum(b.qty) as qty
from master a, detail b where a.for_cod=b.for_code
and A.for_code in ('+@For_code+')'
exec(@str)
end