我想将值存储到选择查询中声明的变量中,但这里的问题是我的选择查询返回多行。请参阅下面的示例
select Col1
from Table1 where Col1 NOT IN (select Col1 from Table2)
and Col3 >=8
------------------
result
73
74
declare @temp1 int
declare @temp2 int
I essentially want @temp1 to hold 73 and @temp2 hold 74 and so fort...
任何关于如何实现这一目标的想法都会有很大帮助。如果您需要更多解释,请告诉我。
提前致谢, 加根