重複の可能性:
複数の Id 値を受け入れる T-SQL ストアド プロシージャ
USE [dbindia]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
alter proc [procedurename]
@srchtxt varchar(50),
@status varchar(50),
@id int
as
select a.listtitle as productname,a.listdesc as description,buyingprice as Price,b.catname as [Primary Category],c.catname as [Secondary Category],d.catname as [Tritary Category],e.catname as [Quartery Category],
a.balanceqty as [Current Stock],
'http://ghsindia.biz/image/product/'+a.imgname as Image1,
'http://ghsindia.biz/image/product/'+a.imgname2 as Image2,
'http://ghsindia.biz/image/product/'+a.imgname3 as Image3,
'http://ghsindia.biz/image/product/'+a.imgname4 as Image4,
'http://ghsindia.biz/image/product/'+a.imgname5 as Image5 from
tbllisting a inner join tblcategory b on a.catid=b.catid
left outer join tblSeccategory c on a.catid2=c.Seccatid
left outer join tbltricategory d on a.catid3=d.tricatid
left outer join tblquarcategory e on a.catid4=e.quarcatid
where a.blockstatus=@status and a.listtitle like '%'+@srchtxt+'%' and a.bstatus=1
**and a.listid in (@id)** order by a.listtitle
これは私のストアドプロシージャです。a.listid
1つ以上になる可能性のあるすべての値を取得したいのですが、idの値が(1,2,3)のような場合、これにどのように書き込むのでしょうか