declare @ww varchar(50)
set @ww='select staff_id from ZC_Staff'
select * from ZC_Staff where staff_id in exec(@ww)
上面的为什么会报错!!
set @ww='select staff_id from ZC_Staff'
select * from ZC_Staff where staff_id in exec(@ww)
上面的为什么会报错!!
set @ww='select * from ZC_Staff where staff_id in(select staff_id from ZC_Staff)'
exec(@ww)
set @ww='select * from ZC_Staff where staff_id in(select staff_id from ZC_Staff)'
exec(@ww)
set @ww='select staff_id from ZC_Staff'
select * from ZC_Staff where staff_id in exec(@ww)
你的语句是查询一个表的所有列?是否写法有得多余?