方式1:

Declare @SQL NVarChar(max)
set @SQL='select *from Loanee as a  ApplicationID in ('+@ApplicationIDs+')'


Create table #t2 (ID int ,
OutCashAccountNo nvarchar(50),
OutName nvarchar(50),
InCashAccountNo nvarchar(50),
InName nvarchar(50),
Amount decimal(18,2),
CashType int ,
OutInvestorApplyID int,
InInvestorApplyID int ,
OperateType int,
AddTime datetime
);

insert into #t2 Exec (@SQL)

select  * from  #t2

方式2:

select * into #t  from dbo.Split('12,12,1,2',',')

然后用 临时表 #t  关联 相应的表 

select *  into #t2  from Loanee as a   left join  #t b  on a.applicationid=b.name

 

select  * from  #t2

 

相关文章:

  • 2021-09-05
  • 2022-12-23
  • 2021-10-18
  • 2021-09-02
  • 2021-11-11
  • 2021-09-27
  • 2021-12-27
猜你喜欢
  • 2021-11-14
  • 2021-07-09
  • 2021-08-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
相关资源
相似解决方案