declare @uphm intdeclare @t table(hm int)
insert into @t(hm)(select news_HM as hm from news where news_bm='0001')创建了一个临时表@t,并且加入了一条数据问题现在我想让@uphm等于@t中的hm,该如何写,换句话说就是我如何取到@t表中的某行某列的值
set @[email protected]
这种写法出现了"必须声明变量@t"错误
insert into @t(hm)(select news_HM as hm from news where news_bm='0001')创建了一个临时表@t,并且加入了一条数据问题现在我想让@uphm等于@t中的hm,该如何写,换句话说就是我如何取到@t表中的某行某列的值
set @[email protected]
这种写法出现了"必须声明变量@t"错误
insert into @t(hm)(select news_HM as hm from news where news_bm='0001')select @uphm=hm from @tselect @uphm
insert into @t(hm)(select news_HM as hm from news where news_bm='0001')
select @uphm=hm from @t
如果hm有多个值要怎么取?
insert into @t(hm)(select news_HM as hm from news where news_bm='0001')select @uphm = hm from @t where ...