问题描述
大家好,
i希望从select语句中捕获变量中的所有值(例如像Employee中的Select *),并且稍后使用捕获的值在另一个询问中。
i已经尝试了很多,但我没有按照我的要求得到..
所以,请帮忙,如果有人有解决方案..
谢谢,
Raj
Hi All,
i want to capture all values in a variable from a select statement(i.e like Select * from Employee) and that captured values is later being used in another query.
i have tried a lot but i am not getting as per my requirement..
so, pls help, if any one has solution..
thanks,
Raj
推荐答案
Select * into #temp from Employee
以上查询创建临时表#temp并将Employee的输出存储到#temp表中
现在需要时要使用存储的数据,您只需将选择查询写为:
Above Query Create Temporary table #temp and Stores output from Employee into #temp table
Now when you want to use stored data, you can just write select Query as :
Select * from #temp
干杯!
Yogendra Dubey
Cheers !
Yogendra Dubey
这篇关于如何从select语句中捕获变量中的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!