declare @indextable table(id int identity(1,1),nid int)
insert into @indextable(nid) select newsid from wqnews where heading like '% '[email protected]+ '% ' order by addtime desc
这是原句,可以通过的,现在的问题是,因为后面的where条件是不确定的,[email protected]
然后这句话怎么写?
declare @indextable table(id int identity(1,1),nid int)
exec( 'insert into @indextable(nid) select newsid from wqnews '[email protected])
这样写是肯定错误的,哪位能告知这句话怎么写不?
万分感谢
------解决方案--------------------
--update
exec( 'declare @indextable table(id int identity(1,1),nid int)
insert into @indextable(nid) select newsid from wqnews '[email protected])
------解决方案--------------------
WangZWang(先来)
----正解